Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: has it been blessed?

by broquaint (Abbot)
on Mar 06, 2002 at 16:08 UTC ( [id://149720]=note: print w/replies, xml ) Need Help??


in reply to has it been blessed?

Try this is you're just checking for the method
if($obj->can("invoke_method")) { $obj->invoke_method(); }
wait til 5.8 for the blessed() function or read ehdonhon's node.
HTH

broquaint

Replies are listed 'Best First'.
Re: Re: has it been blessed?
by gellyfish (Monsignor) on Mar 06, 2002 at 16:17 UTC

    or wait til 5.8 for the blessed() function.

    Or get it now by installing the module Scalar::Util from CPAN ;-}

    /J\

Re: Re: has it been blessed?
by ehdonhon (Curate) on Mar 06, 2002 at 16:09 UTC

    If $obj hasn't been blessed at all, that will still fail.

      But you can use can in a non-OO way: if (UNIVERSAL::can($obj, 'method'))

      dave hj~

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-16 18:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found