in reply to Anyway to Have Strong-Like Typing

This is likely not what you want, but since you mentioned integers, I just wanted to point out use integer; in case you haven't seen that yet.

Other than that, I'd second kennethk's post, all very good suggestions.

Replies are listed 'Best First'.
Re^2: Anyway to Have Strong-Like Typing
by AnomalousMonk (Archbishop) on Aug 11, 2014 at 21:22 UTC

    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!