Your second example is on track: treat @_ as a hash.
When you use an array as a hash, it is automatically broken up into key, value pairs.sub newfoo { my %hash = @_; foreach (keys %hash) {print "$_: $hash{$_}\n";} }
http://www.nodewarrior.org/chris/
In reply to Re: Getting pair of values from an array
by innerfire
in thread Getting pair of values from an array
by vladb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |