Mike Blezien wrote:
Hello,
occasionally we get this error, due to a mis coding error or type-O
error, but was wondering is there away to check, with a perl code, to
make sure the sub routine exists before displaying this system 500
internal error message. the error I'm referring too is this:
Undefined subroutine main::some_routine_name called at script_name line
XXX
TIA
If they are miscodings then not really, mostly because Perl allows you
to choose subroutines/methods at runtime. So the interpreter can't know
a pri ori what subs need to exist. If you need to check for a sub to see
whether or not you should be calling it, for instance to see if an
object has a particular method you can use the UNIVERSAL::can function,
see perldoc UNIVERSAL for more info.
Of couse having said all that, aren't you testing ;-)
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response