
shafathperl2011
New User
Jun 1, 2011, 2:52 PM
Post #6 of 7
(14884 views)
|
I modified the code as below Code1 : ======= #! /usr/bin/perl use strict; use warnings; my $var1=100; my $var2="safath"; print $var1+$var2-20; print "\n"; Output1 ======== Argument "safath" isn't numeric in addition (+) at checkArithmetic.pl line 9. 80 If I change the code as, Code 2: ====== #! /usr/bin/perl use strict; use warnings; my $var1=100; my $var2="information"; print $var1+$var2-20; print "\n"; It prints: Output2: ======= Argument "information" isn't numeric in addition (+) at checkArithmetic.pl line 9. INF My question is , the output should be '80', but why it is printing 'INF' ?
|