Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Illogical logic statement

by GrandFather (Sage)
on Dec 02, 2012 at 21:16 UTC ( #1006757=note: print w/ replies, xml ) Need Help??

in reply to Illogical logic statement

When I execute:

#!/usr/bin/perl use strict; use warnings; my $str = 'false'; if ($str == 'true') { print "$str=true\n"; } else { print "$str=false\n"; }

I get:

Argument "true" isn't numeric in numeric eq (==) at line 7. false=true Argument "false" isn't numeric in numeric eq (==) at line 7.

which is a pretty good heads up! Always use strictures (use strict; use warnings; - see The strictures, according to Seuss).

True laziness is hard work

Comment on Re: Illogical logic statement
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2015-11-29 03:02 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls