Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to get a slice of hash ref that a sub returns.

by TheHobbit (Pilgrim)
on Apr 18, 2002 at 22:21 UTC ( [id://160368]=note: print w/replies, xml ) Need Help??


in reply to How to get a slice of hash ref that a sub returns.

Hi,
Simple, make it simple...

sub x {return {a => 1, b=> 2, c => 3}} print @{x()}{a,b}
does the job.

Cheers
Leo TheHobbit
GED/CS d? s-:++ a+ C++ UL+++ P+++>+++++ E+ W++ N+ o K? !w O? M V PS+++
PE-- Y+ PPG+ t++ 5? X-- R+ tv+ b+++ DI? D G++ e*(++++) h r++ y+++(*)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-18 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found