Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Hash Ref Initialization

by mwah (Hermit)
on Dec 10, 2007 at 20:51 UTC ( [id://656225]=note: print w/replies, xml ) Need Help??


in reply to Hash Ref Initialization

simply by 'hash intialization' (%$hash_copy = %$hash_ref):

use strict; use warnings; my $hash_ref = { hack => 'slash', frobozz => 'portrait', candle => 'lit', }; my $hash_copy; %$hash_copy = %$hash_ref; map $_ .= '_mod', values %$hash_copy; # encouraged in v.5.10 print map "$_ => $hash_ref->{$_} \n", keys %$hash_ref; print map "$_ => $hash_copy->{$_} \n", keys %$hash_copy;

Regards

mwa

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://656225]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 17:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found