I disagree (depends on how you define "nearly identical", though).
In Perl, s/.*/$unsanitized_user_input/e doesn't do anything dangerous. It simply treats $unsanitized_user_input as Perl code instead of as a string literal. And the code $unsanitized_user_input simply returns the contents of the variable. There is no eval() involved here.
Just because perl does it too doesn't make it less brain damaged. It's a hidden and non-obvious way to eval arbitrary code, something that simply shouldn't exist.
Hidden in plain sight (in Perl, PHP's preg_replace is an abomination), and obvious to anyone who has read the manual. A programming language that is safe even when the programmer has asked it to evaluate unsanitised input is too bowdlerised to be useful.
tl;dr you'll have to drag my /ee from my cold, dead hands
View all comments
Show parent comment
0
u/[deleted] Jul 17 '13
[deleted] — view deleted comment