Sadly this is not the only problem. You might also try testing foo2you and foo2.1C:\>type test.pl foreach (1.2, foobar){ print &is_int ($_)?"$_ is an integer\n":"$_ is not an integer\n"; } sub is_int{ my $testvar =shift; use integer; my $intval=$testvar_*1; no integer; return $testvar == $intval; } C:\>perl test.pl 1.2 is not an integer foobar is an integer C:\> C:\>type test.pl $_ = 'foobar'; print "'$_' is an integer" if is_int($_); sub is_int { $_[0] == int $_[0]; } C:\>perl test.pl 'foobar' is an integer C:\>
In reply to Re: Integer detection concept
by tachyon
in thread Integer detection concept
by boo_radley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |