There's more than one way to do things | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Rather than dealing with an appalling mess of curlies and sigils... I can't recall ever wanting to take a slice of a hashref myself, but this line aroused my curiosity, so I investigated to see just how bad it could be. First I went for the naive approach: my @stuff = @$href{ qw/key1 key2 key3/ };And was rather surprised to discover that I'd got it right first try! Perhaps the reason this seems intuitive to me and not to you because I already habitually write $$href{key1} rather than $href->{key1}, so I'm used to using double sigils to dereference things? (Henceforth I shall use this consistency as an argument in favour of my preferred syntax!) In reply to Re^2: What would you change?
by Porculus
|
|