in reply to use string as a piece of code
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use string as a piece of code
by daverave (Scribe) on Jul 30, 2010 at 16:49 UTC |