in reply to Mapping Array
But as pg showed in the first reply, map is good for when you want to derive a set of modified values from an array or list, by applying a chunk of code to each element.sub show_scalars { my ( $str1, $str2, $str3 ) = @_; print "Last was $str3, preceded by $str2, and $str1 was first\n"; } my @array = qw/one two three/; show_scalars( @array );
|
|---|