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

Re: pushing hash values to an array

by blazar (Canon)
on Oct 16, 2006 at 11:51 UTC ( [id://578477]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/local/bin/perl
    use strict;
    use warnings;
    %h=('1', 'one', '2', 'two', '3', 'three');
    
  2. or download this
    @arr=(1,2);
    
  3. or download this
    foreach $key(keys %h)
    {
    push(@arr,$h{$key});
    }
    print @arr;
    
  4. or download this
    foreach $key(keys %h)
    {
    push(@arr,$$h{$key});
    
  5. or download this
    print "@arr\n";
    }
    
  6. or download this
    push @arr, $href->{$key};
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-19 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found