Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: sub always returns 1

by ungalnanban (Pilgrim)
on Mar 04, 2010 at 06:54 UTC ( #826624=note: print w/ replies, xml ) Need Help??


in reply to sub always returns 1

See the following Example
#use strict; #use warnings; my $var = "Hello World"; if ($var == "Hello World"){ print "Equal\n"; } if ($var eq "Hello World"){ print "Strings are Equal\n";} if ($var == "Hello world"){ print "Equal\n"; }

Here I didn't use the "use strict" and "use warnings".
so the program give the output
Output:
Equal
Strings are Equal
Equals

if I used the "use strict" and "use warning".
Then the output of the program is (different).
Output
Equal
Strings are Equal
Argument "Hello world" isn't numeric in numeric eq (==) at equal.pl line 21.
Equal


--sugumar--


Comment on Re: sub always returns 1
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2015-07-29 12:34 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 (263 votes), past polls