RE: can´t call method "xyz" on an undefined value at...

2004-09-03 Thread Charles K. Clarkson
Bastian Angerstein <[EMAIL PROTECTED]> wrote:

: Now I gate can´t call methode can on an undefined
: value xyz line xyz. Any Idea?
 

Show us your code.





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: can´t call method "xyz" on an undefined value at...

2004-09-03 Thread Charles K. Clarkson
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]
 




Re: can´t call method "xyz" on an undefined value at...

2004-09-03 Thread Ing. Branislav Gerzo
Bastian Angerstein [BA], on Friday, September 3, 2004 at 10:19 (+0200)
wrote these comments:


BA> I, once again, have a question.
BA> How can I check if a Method is undefined or not without getting this error?

maybe defined() helps.

-- 

 ...m8s, cu l8r, Brano.

[Love conquers all things but poverty and toothache.]



-=x=-
Skontrolované antivírovým programom NOD32


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]