Anish Kumar K wrote:
Hi All
Hello,
The code gives strange error
$subject = I get some value from the function
if ($subject eq '' || !defined $subject) { Some operation }
Operation `eq': no method found, left argument in overloaded package XML::LibXML::NodeList, right argument has no overloaded magic at test.pl
why the strange error is coming. I could print the value of $subject......Isn;t it treated as a string.....
Hmm, show the entire code (w/ strict and warnings) as it works fine:
$ perl -e 'if ($subject eq "" || !defined $subject) {print "no subject\n";}' no subject $
or (w/ strict & warnings)
$ perl -mstrict -we 'my $subject;if (!defined $subject || $subject eq "") {print "no subject\n";}'
no subject
$
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>