Bastian Angerstein <[EMAIL PROTECTED]> wrote:
: How can I check if a Method is undefined or not without
: getting this error?
Assuming you mean the method to an object. Use the
UNIVERSAL method 'can'.
use CGI;
my $q = CGI->new();
print "method 'xyz' invalid for '\$q'\n" unless $q->can( 'xyz' );
print "method 'xyz' valid for '\$q'\n";
__END__
use CGI ('xyz');
my $q = CGI->new();
print "method 'xyz' invalid for '\$q'\n" unless $q->can( 'xyz' );
print "method 'xyz' valid for '\$q'\n";
__END__
HTH,
Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>