Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open fh, "<", "b.txt" or die $!;
- open fh1, "<", "a.txt" or die $!;
- my $i = 0;
- while(my $item1 = <fh>)
- {
- open fh2, ">>", "a$i.txt" or die $!;
- while(my $item2 = <fh1>)
- {
- if($item1 =~ m/$item2/i)
- {
- print fh2 $item1, $/;
- print fh2 <fh>;
- }
- }
- close fh2;
- seek fh1, 0, 0;
- }
- close fh;
- close fh1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement