Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How do you determine if a user-defined function exists?

by ysth (Canon)
on Nov 30, 2004 at 07:12 UTC ( [id://411121]=note: print w/replies, xml ) Need Help??


in reply to How do you determine if a user-defined function exists?

defined &myfunc will tell if it is defined, but usually (especially for imports from modules) it is better to see if it is declared instead; exists &myfunc will do that. The difference is functions that have a forward declaration like sub myfunc; and are implemented via AUTOLOAD (e.g. AutoLoader/SelfLoader). exist &foo will be true for these functions, but defined &foo will not.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-26 02:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found