in reply to Re^2: Passing a regex from a CGI HTML form (user supplied regex substitution without eval)
in thread Passing a regex from a CGI HTML form
Seems like these types of modules try to make an explicitly unsafe course of action less unsafe.
From String::Interpolate::RE Docs -
This module interpolates variables into strings using regular expression matching rather than Perl's built-in interpolation mechanism and thus hopefully does not suffer from the security problems inherent in using eval to interpolate into strings of suspect ancestry.
From String::Interpolate Docs -
Because the Perl string interpolation engine can call arbitrary Perl code you do not want to want to use it on strings from untrusted sources without some precautions. For this reason String::Interpolate objects can be made to use Safe compartments. This is, of course, only as safe as Safe and you are advised to read "WARNING" section of the Safe documentation.
Your code did not compile for me, but I guess the point is to try and override the substitution operator with some subset of safer features. I acknowledge that could be successful, but also the op could just use eval in any context where all user input is trusted and be fine. The OP is troubleshooting his gambling code on the clock here so every second counts.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Passing a regex from a CGI HTML form (user supplied regex substitution without eval)
by Anonymous Monk on Sep 01, 2016 at 02:21 UTC | |
by trippledubs (Deacon) on Sep 01, 2016 at 04:37 UTC | |
by Anonymous Monk on Sep 01, 2016 at 06:51 UTC | |
by trippledubs (Deacon) on Sep 01, 2016 at 12:04 UTC | |
by Anonymous Monk on Sep 01, 2016 at 19:14 UTC |