in reply to How to tell if a function exists?

print "Exists\n" if exists &subroutine; print "Defined\n" if defined &subroutine;
From perldoc -f exists

Replies are listed 'Best First'.
Re: Re: How to tell if a function exists?
by John M. Dlugosz (Monsignor) on Jan 05, 2003 at 04:58 UTC
    Ah,
    Given an expression that specifies the name of a subroutine, returns true if the specified subroutine has ever been declared, even if it is undefined.
    OK, so exists tells me if its ever used anywhere and thus in the symbol table (even if never defined), and defined tells me if it was actually present.

    --John