use Types::Common qw( Int ); tie my $x, Int; $x = 5; $x += 1; print $x, "\n"; # prints "6" $x = "7"; # this is fine, even though it's quoted $x += 0.5; # dies because 7.5 isn't an integer
In reply to Re: way of declare an integer variable instead use /^\d+$/
by tobyink
in thread way of declare an integer variable instead use /^\d+$/
by vincentaxhe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |