in reply to Reading from file
Since strings evaluate to themselves, you could just change one line to this:
This would work properly only if you had nothing but strings and regexes in your input file.
And as gaal mentions above, it's very dicy and highly insecure. You're essentially running unknown code -- even if you wrote the contents of the file yourself, a typo can cause havoc.
Update
gaal's comment below is correct. I misspoke. But the warning about eval'ing input strings is still true.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading from file
by gaal (Parson) on Jan 06, 2005 at 23:44 UTC |