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

Re: test for subroutine existence

by ehdonhon (Curate)
on Aug 12, 2002 at 17:00 UTC ( [id://189547]=note: print w/replies, xml ) Need Help??


in reply to test for subroutine existence

As long as you are using a simple module with no inheritance, you could rely on can to do this:

if ( __PACKAGE__->can( 'sub_to_test' ) ) { ... }

Log In?
Username:
Password:

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

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

    No recent polls found