Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 scrutinizing the Monastery: (8)
As of 2014-07-29 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls