kingofking has asked for the wisdom of the Perl Monks concerning the following question:
Dear all,
I am trying to find whether a particular subroutine exists or not.
so far I have tried...is
if (&test;) { test(); } sub test { #do something; }
If the subroutine "test" does not exists, it is popuping an error as :
Undefined subroutine &main::test called at script.pl
Kindly suggest me.
Thanks
King
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to find a subroutine exists or not
by revdiablo (Prior) on Apr 20, 2006 at 14:31 UTC | |
by diotalevi (Canon) on Apr 20, 2006 at 15:38 UTC | |
by mrpeabody (Friar) on Apr 20, 2006 at 16:11 UTC | |
by xdg (Monsignor) on Apr 20, 2006 at 17:21 UTC | |
|
Re: how to find a subroutine exists or not
by Zaxo (Archbishop) on Apr 20, 2006 at 14:57 UTC | |
by diotalevi (Canon) on Apr 20, 2006 at 15:36 UTC | |
by japhy (Canon) on Apr 20, 2006 at 15:25 UTC | |
|
Re: how to find a subroutine exists or not
by sen (Hermit) on Apr 20, 2006 at 17:19 UTC | |
|
Re: how to find a subroutine exists or not
by pileofrogs (Priest) on Apr 20, 2006 at 21:06 UTC | |
by codeacrobat (Chaplain) on Apr 21, 2006 at 11:18 UTC |