Unroll it, bit by bit:
| @_ | We'll take the parameters passed to the sub.. |
| {@_} | ..and make an anonymous hash out of them. |
| {{@_}}{ ... } | ..now we're going to dereference this hashref.. |
| @{{@_}}{qw/ ... /} | ..but take a slice of it when we do so; |
| @{{@_}}{qw/foo bar/} | Specifically, we'll extract the foo and bar values from the hashref.. |
| my ($foo, $bar) = @{{@_}}{qw/foo bar/} | ..and put them into $foo and $bar |
Essentially, the code is equivilent to the following, but avoids the %args variable:
sub foobar { my %args = @_; my $foo = $args{foo}; my $bar = $args{bar}; }
perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'
In reply to Re: Explanation of commonly used Perl
by Chmrr
in thread Explanation of commonly used Perl
by tradez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |