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

2004-09-03 Thread Bastian Angerstein

Good Morning,

I, once again, have a question.

How can I check if a Method is undefined or not without getting this error?




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




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

2004-09-03 Thread Bastian Angerstein
Now I gate can´t call methode can on an undefined value xyz line xyz.
Any Idea?


-Ursprüngliche Nachricht-
Von: Charles K. Clarkson [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 3. September 2004 10:37
An: 'Bastian Angerstein'; 'Mailinglist Perl Beginners'
Betreff: RE: can´t call method "xyz" on an undefined value at...


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>




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]
 




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 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]