Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Better way to dereference a shifted hashref arg?

by fireartist (Chaplain)
on Jun 15, 2005 at 15:42 UTC ( #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

  • Comment on Re: Better way to dereference a shifted hashref arg?

Replies are listed 'Best First'.
Re^2: Better way to dereference a shifted hashref arg?
by ikegami (Pope) 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
Node Status?
node history
Node Type: note [id://466953]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2021-01-18 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?