in reply to array and hash
Something along those lines.my @array = get_items(); # whatever. the input. my @results; # each element is a pair: [ input, output ] for my $item ( @array ) { my $output = some_function($item); push @results, [ $item, $output ]; } # now print: for ( @results ) { my( $input, $output ) = @$_; print "Input: $input. Output: $output\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: array and hash
by jdporter (Paladin) on Jun 09, 2005 at 20:44 UTC | |
|
Re^2: array and hash
by Anonymous Monk on Jun 09, 2005 at 23:59 UTC |