Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The first print @$Outcome shows all the lines, the second one print @$Outcome shows only line with potato. Where is my mistake? Thank you! GHuse 5.010; use strict; use warnings; my $Outcome; while (<DATA>) { my @Result = (); next unless $_ =~/\d+\schunk/; s/\s+/ /g; push @Result, $_."\n"; $Outcome = \@Result; print "@$Outcome"; } print "X\n"; #debug print "@$Outcome"; __DATA__ Free text. Free text. Blah Blah Blah Transaction XXX Apple 28 chunk Pear 140 chunk cherry 231 chunk potato 1 chunk Sincerely Yours
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array reference
by moritz (Cardinal) on Jun 09, 2011 at 12:03 UTC | |
by Anonymous Monk on Jun 09, 2011 at 12:22 UTC | |
by moritz (Cardinal) on Jun 09, 2011 at 12:49 UTC | |
by Anonymous Monk on Jun 09, 2011 at 12:55 UTC | |
by DStaal (Chaplain) on Jun 09, 2011 at 12:52 UTC | |
by Anonymous Monk on Jun 09, 2011 at 12:48 UTC |