Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^4: What is true and false in Perl?

by Anonymous Monk
on Apr 15, 2012 at 02:16 UTC ( #965117=note: print w/ replies, xml ) Need Help??


in reply to Re^3: What is true and false in Perl?
in thread What is true and false in Perl?

Only in the context of perl -e, as when run from a script, generates the same error (Argument "0 but true" isn't a numeric in addition (+) at line #. Also, both still print 0. And in both cases the attempt to add the string to 0 is ignored.


Comment on Re^4: What is true and false in Perl?
Re^5: What is true and false in Perl?
by AnomalousMonk (Abbot) on Apr 15, 2012 at 02:42 UTC

    Not quite sure what you are saying, but neither is behavior different when run as a 'script' versus on the command line via -e, nor is the arithmetic operation 'ignored'.

    >cat 0_but.pl use warnings; use strict; print 42 * '0 but true', "\n"; print 42 * '0 but zonk', "\n"; >perl 0_but.pl 0 Argument "0 but zonk" isn't numeric in multiplication (*) at 0_but.pl +line 5. 0

    Update: Verfied on ActiveState 5.8.9 and Strawberries 5.10.1, 5.12.3 and 5.14.2.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://965117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-07-02 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls