#!/usr/bin/perl use Modern::Perl; # 946284 my $ref = 7; for (1 .. 8 ) { if ($ref == $_) { say "\$ref: $ref"; # adjust output to id source of match? } else { say "Tain't workin'"; } }
Seems to me this might be readily expansible to your larger goal as outlined in Re^2: Range Operator in If Statement
In reply to Re: Range Operator in If Statement
by ww
in thread Range Operator in If Statement
by mmartin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |