use Types::Common::Numeric 1.003_002 qw(IntRange); my $range = IntRange[ $y-1 => $y+1 ]; if ($range->check($x)) { ...; }
A Megabyte-sized package (uncompressed [Type-Tiny-1.002002.tar.gz), plus dependencies, plus a ton of objects generated just for a trivial range check? Isn't that a tiny bit too FAT?
Alexander
In reply to Re^2: IF condition with a range
by afoken
in thread IF condition with a range
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |