in reply to Re: Anyway to Have Strong-Like Typing
in thread Anyway to Have Strong-Like Typing
I'll third the AnonyMonk's second, and only add that the integer pragma is lexically scoped, so there's some leeway for creative use of it:
c:\@Work\Perl\monks>perl -wMstrict -le "my $z = S(2, 7); print $z; $z += 2.345; print $z; ;; sub S { use integer; my ($x, $y) = @_; return $x * ($y + 1.234); } " 16 18.345
Oh, and BTW, integer applies to operations, not variables!
|
|---|