Hellena has asked for the wisdom of the Perl Monks concerning the following question:
0 down vote favorite
I have problem with my code cose of this part:
I need it to be only one time printed 'print Dump($post)' Here is all that partforeach my $line(keys %results){ print Dump($post) if $results{$line} == 1; }
my $f1 = "/home/hellena/Desktop/data.txt"; my $f2 = "/home/hellena/Desktop/ini.txt"; my %results = (); open FILE1, "$f1" or die "Could not open file: $! \n"; while(my $line = <FILE1>){$results{$line}=1; } close(FILE1); open FILE2, "$f2" or die "Could not open file: $! \n"; while(my $line =<FILE2>) { $results{$line}++; } close(FILE2); foreach my $line(keys %results){ print Dump($post) if $results{$line} == 1; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to add each line into single line in txt file PERL?
by Ratazong (Monsignor) on Feb 19, 2013 at 13:41 UTC | |
by Hellena (Initiate) on Feb 19, 2013 at 13:48 UTC |
Back to
Seekers of Perl Wisdom