Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: setting hash keys by array

by Aristotle (Chancellor)
on Sep 09, 2002 at 19:22 UTC ( #196404=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $hash{red}{green}{brown} = { }
  2. or download this
    my $ptr = \%hash;
    $ptr = $ptr->{$_} = {} for @array[0..$#array-1]; # fixed; s/shift @arr
    +ay/$_/
    $ptr->{$array[-1]} = 1;
    
  3. or download this
    my $ptr = \%hash;
    $ptr = $ptr->{shift @array} = {} while @array > 1;
    $ptr->{$array[0]} = 1;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2022-01-18 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (54 votes). Check out past polls.

    Notices?