Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: OO sub, hash or hash reference.

by dash2 (Hermit)
on Feb 18, 2002 at 16:57 UTC ( [id://146169]=note: print w/replies, xml ) Need Help??


in reply to OO sub, hash or hash reference.

Assuming you aren't too bothered about blessed references, how about this?
sub xxx { my $class = shift; my $args = ($#_ == 0) ? { %{ (shift) } } : { @_ };

NB: not my own work.

dave hj~

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found