No such thing as a small change | |
PerlMonks |
Re: Please don't use eval for this! (was Re: List Values As Multidimensional Hash Keys)by rdm (Hermit) |
on Mar 15, 2004 at 00:54 UTC ( [id://336574]=note: print w/replies, xml ) | Need Help?? |
Being of the ornery sort, this (to me) begs the following question: Efficiency aside, is there a *safe* way to utilise eval as a solution to this problem? Not a "good" way, or even a "mediocre" way, just safe? The intrinsic problem with eval is the possibility of hostile data being introduced into to evaluated string. So, is there a way of rendering the data safe? The obvious way is via taint checking, and string sanitising with tr or s, but is there a better way? Not that this should be construed as approval of the idea - the process startup overheads alone should be reason enough to do it any other way! -R
In Section
Seekers of Perl Wisdom
|
|