in reply to Range Operator in If Statement
If you are able to upgrade to a newer version of Perl, starting with v5.10, you can use the smart match operator, eg:
use 5.010; my $ref = 7; if ( $ref ~~ [ 1 .. 8 ] ) { ... }
|
---|
In Section
Seekers of Perl Wisdom