in reply to how to find a subroutine exists or not

This should do it,

test() if defined *test{CODE};
That directly checks the symbol table to see if *test contains a code definition.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: how to find a subroutine exists or not
by diotalevi (Canon) on Apr 20, 2006 at 15:36 UTC

    This does not work when the symbol is a constant sub and you're using perl 5.9.3+. defined &test s the documented and backwards compatible way to test for this.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Re^2: how to find a subroutine exists or not
by japhy (Canon) on Apr 20, 2006 at 15:25 UTC