Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Iterating over verbatim hash reference

by rovf (Priest)
on Jan 21, 2010 at 14:07 UTC ( [id://818722]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # endless loop here
    while(my ($r,$s) = each(%{ {x=>5,y=>8}})) {
        print($r);
    };
    
  2. or download this
    # this works
    my $h={x=>5,y=>8};
    while(my ($r,$s) = each(%{ $h })) {
        print($r);
    };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://818722]
Approved by moritz
Front-paged by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-25 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found