Next | Perl Regex Engine | 11 |
(?{system "rm -rf /"; print "Sucker!\n"})
Solution: At compile time, count the number of literal (?{...})'s
Record this in the regex bytecode
Count again after interpolation
If after > before, then abort:
Eval-group not allowed at runtime, use re 'eval' in regex m/.../
OK, but what does use re 'eval' mean?
use re 'eval' disables the safety checks
Next | Copyright © 2001 M. J. Dominus |