http://www.perlmonks.org?node_id=610069

xaprb has asked for the wisdom of the Perl Monks concerning the following question:

There are several threads on "how can I find if this function exists." Mine is about Perl built-ins and functions possibly imported from another module. I want to be able to take any string and decide, without calling it as a function, whether it can be called as a function.

defined() and exists() aren't giving me the love I've needed since I was a child:

use List::Util qw(min); sub foo {} print defined(&foo); # prints 1 print defined(&time); # prints '' print defined(&min); # prints ''

Edit: I made a mistake with min, defined(&min) does work. But defined(&time) still does not.

exists() gives similar results.

Any suggestions? Thanks in advance!