I quote from perldoc perldiag:
      Argument "%s" isn't numeric%s
           (W numeric) The indicated string was fed as an argument to an
operator that expected a
           numeric value instead.  If you're fortunate the message will
identify which operator was
           so unfortunate. 

What I am assuming is that while "5" is forced into numeric form after
being interpolated - because it can; "5&6" can't be forced into numeric
form without being evaluated. As such, since the + operator is expecting
a number on both sides, we get the warning.

 
Best Regards,
Dov Levenglick
DSP SoC System and Applications Engineer,
Network and Computing Systems Group
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[ ] Freescale General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary
[x] Personal Memorandum

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Jason Elbaum
Sent: Thursday, May 03, 2007 07:54
To: Oron Peled
Cc: [email protected]
Subject: Re: [Israel.pm] Strange "Argument isn't numeric" warning

> Since you quoted it, it's a string. However, since it is used
> in numeric context (because of +), Perl tries to convert it
> to number.

Which is fine.


> Perl conversion work very similar to atof(3) [maybe it even use it,
didn't
> bother to check]. It convert the numeric content of the string and
stops
> conversion when it hits non-numeric characters.

Also fine.


> That's why "5&6" is converted to 5 in numeric context. And for the
> same reason the string "hello" is converted to 0 (conversion stops
> right at the beginning of the string).

Still fine.


> Hope it is clear now.

No - you haven't explained why I get a "non-numeric" warning.


Jason
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl

_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl

Reply via email to