Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Is it possible to use key/values of a Hash/Hash ref while it's being initialized?

by fishbot_v2 (Chaplain)
on Sep 14, 2005 at 21:23 UTC ( [id://492028]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %hash = map {
                      my $foo;
    ...
                              key2 => alter( $foo ),
                            }
                   } @list;
    
  2. or download this
    my %hash = map {
                      my $foo = { key1 => 'longstring'.$_.'more' };
                      $foo->{"key2"} = alter( $foo->{"key1"} );
                      $_ => $foo;  
                   } @list;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-03-29 10:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found