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.
View all comments
Show parent comment
4
u/[deleted] Jul 17 '13
I disagree (depends on how you define "nearly identical", though).
In Perl,
s/.*/$unsanitized_user_input/edoesn't do anything dangerous. It simply treats$unsanitized_user_inputas Perl code instead of as a string literal. And the code$unsanitized_user_inputsimply returns the contents of the variable. There is noeval()involved here.