Use eval, if you must.
my $range = '1..10'; for my $x ( eval $range ) { print "$x\n"; }
Beware, however, that input validation is very important here. The string you pass into eval can be any Perl code, and it will do whatever that code does.
In reply to Re^3: Specifying a range through a variable
by kyle
in thread Specifying a range through a variable
by Zubinix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |