in reply to Re^2: Compare two file text input, compare it, replace and write new file
in thread Compare two file text input, compare it, replace and write new file

Solved by adding chomp
while ( <SFILE> ) { chomp my @words = split /(?=\\)/; for my $word ( @words ) { $word = $words{ $word } if exists $words{ $word }; } print TFILE "@words\n<br>"; }
another question: is it OK, if I used hash array my "data" (DFILE) on that program contain about 5000 lines ?
my %words; while (<DFILE>) { chomp; my ($key, $val) = split /:/; $words{$key} = $val; };