in reply to sub always returns 1
See the following Example
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--
#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--
|
---|
In Section
Seekers of Perl Wisdom