[Melbourne-pm] passing arrays and hashes
Brendon Oliver
brendon.oliver at gmail.com
Sun Aug 5 20:21:37 PDT 2007
On Monday 06 August 2007 13:08:16 Tim Connors wrote:
> Being a readonly copy, can I simply adopt
> the slightly more verbose referencing to ${$trashmd5p}{key} everytime
> instead of $trashmd5{key}, and this wouldn't go and recreate a fresh hash
> from scratch?
Short answer is, I believe, yes. But (to me), ${$trashmd5p}{key} would be
more clearly written as:
$trashmd5p->{key}
you won't get a 2nd copy of the entire hash which is what you're doing when:
my %trashmd5=%$trashmd5p;
(caveat: not knowing what else you might be doing with the contents of
$trashmd5p, there might be better / other solutions too).
Cheers,
- Brendon.
--
Distress, n.:
A disease incurred by exposure to the prosperity of a friend.
-- Ambrose Bierce, "The Devil's Dictionary"
13:17:33 up 6:23, 1 user, load average: 0.25, 0.19, 0.23
More information about the Melbourne-pm
mailing list