my $str = '1..3,10..14'; do_something($_) for eval $str;
Just be very sure that you trust whoever created the file you're reading from. What happens if it contains "system qw{rm -rf /}" (or the equivalent on your OS)?
update: Added code
In reply to Re: use string as a piece of code
by FunkyMonk
in thread use string as a piece of code
by daverave
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |