in reply to Explanation of commonly used Perl
Well, first I have never used, nor seen this code, so it is probably not that common.
It is quite clever though: it lets you call foobar with named parameters passed through a hash: use foobar( bar => 'value of bar', foo => 'this is foo') and $foo will be 'this is foo' and $bar will be 'value of bar'.
What happens is that %{{@_}} takes @_ and turns it into a hash: the content of @_ ({@_}) is used to create an anonymous hash (%{{@_}}). But what you really want here is only the values, not the keys from this hash, so all (!) you have to do is take a slice of this hash: @{{@_}}{'foo', 'bar'} is the list of values associated to the keys foo and bar in the hash.
Sweet!
|
|---|