Welcome vcorby,
Your script isn't doing what you think! Please look at 'split'. You need to 'slurp' the file into an array or use a loop to get your first file. (untested)
my @strings = (); open (my $F1, "<", $f1) || die "! open-100 $!";; # open file 1 while ( my $input = <$F1> ) { chomp( $input ); # take off the line breaks $strings[$#strings] = $input; } close $F1;
And life will be easier for you if you start using the 3 parameter 'open' from the beginning:
This gives you a start and ask more as you get closer.open (my $F3, ">", $f3 ) || die "! open-300 $!";
Note: I like to number my 'die's so it's quicker to find the problem. If you have a 50K line script, you'll be glad you did :-).
Regards...Ed
"Well done is better than well said." - Benjamin Franklin
In reply to Re: search contents of one file and replace with contents of another to make a new file
by flexvault
in thread SOLVED!!!: search contents of one file and replace with contents of another to make a new file
by vcorby
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |