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

Re: Better way to dereference a shifted hashref arg?

by fireartist (Chaplain)
on Jun 15, 2005 at 15:42 UTC ( [id://466953]=note: print w/replies, xml ) Need Help??


in reply to Better way to dereference a shifted hashref arg?

my $arg = %{+shift} or die "no arg";

update: bad solution

Replies are listed 'Best First'.
Re^2: Better way to dereference a shifted hashref arg?
by ikegami (Patriarch) on Jun 15, 2005 at 18:13 UTC
    Assuming you meant my %arg, your code has two problems: 1) It gives a warning before dying when it's undef, and 2) it also dies when a ref to an empty hash is passed.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://466953]
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: (4)
As of 2024-03-29 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found