Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Array to hash refs

by BrowserUk (Patriarch)
on Aug 14, 2002 at 08:06 UTC ( [id://190003]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @array = qw /a b c d e f/;
    my $hash;
    my $val = 1;
    ($hash->{pop @array}, $val, $hash) = ($val, $hash, undef) while @array
    +;
    $hash = $val;
    
  2. or download this
    my @array = qw /a b c d e f/;
    my $hash = 1;
    my $tmp;
    
    ($tmp->{pop @array}, $hash, $tmp) = ($hash, $tmp, undef)  while @array
    +;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-24 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found