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

Re: Re (tilly) 2: passing subroutine arguments directly into a hash

by Hofmator (Curate)
on Oct 22, 2001 at 14:31 UTC ( #120490=note: print w/replies, xml ) Need Help??


in reply to Re (tilly) 2: passing subroutine arguments directly into a hash
in thread passing subroutine arguments directly into a hash

sub excise_arg { my $args = shift; my $arg_name = shift; if (exists $args{$arg_name}) { return delete $args{$arg_name}; } [...]

Shouldn't that be

if (exists $args->{$arg_name}) { return delete $args->{$arg_name}; }
as you are passing a hashreference into your function?

Apart from that detail I really like this way :)

-- Hofmator

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2021-05-08 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (96 votes). Check out past polls.

    Notices?