Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

How do I take a slice of a hash reference?

by entropy (Sexton)
on May 15, 2001 at 03:17 UTC ( [id://80399]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $arr =[1,'a',2,'b'];
    my $hash={1,'a',2,'b'};
    print join ':',(@$arr )[1,2];
    print join ':',(@$hash){1,2};
    
  2. or download this
    print join ':',(1,'a',2,'b')[1,2];
    print join ':',(1,'a',2,'b'){1,2};
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-25 11:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found