|Difference.txt = should be displayed as follow: |
[dictiiontionary info am]
whereas actual output was "dictiiontionary.txt file info an array. If a word in the words.txt file doesn't exist in the dictionary.txt file, it is considered misspelled. I "
Where I made a mistake?
modified as suggested below=
my @dictionary_array = ();
my $infile = 'words.txt';
tie @dictionary_array, 'Tie::File', $dfile or die "Cannot open $dfile: !$\n";
open(IN, '<', $infile) or die "Could not open file $infile: $! +";
open(OUT, '>', $outfile) or die "Could not open file $outfile: $! +";
while ( my $myline = <IN> )
my $is_not_there = grep $_ eq $myline, @dictionary_array;
print OUT "$myline ";