Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: OO sub, hash or hash reference.

by dreadpiratepeter (Priest)
on Feb 18, 2002 at 15:11 UTC ( [id://146159]=note: print w/replies, xml ) Need Help??


in reply to Re: OO sub, hash or hash reference.
in thread OO sub, hash or hash reference.

Out of curiosity, why the isa instead of a ref($_[0]) eq 'HASH'?

-pete
Entropy is not what is used to be.

Replies are listed 'Best First'.
Re: Re: Re: OO sub, hash or hash reference.
by IOrdy (Friar) on Feb 18, 2002 at 15:19 UTC
    after seeing the above code I did some reading:

    "The reason the original test is fragile ( ref($_[0]) eq 'HASH' ) is that it will make your code refuse to work on a hash if it happens to be blessed."

    It was simpler than I thought.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://146159]
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 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found