Think about Loose Coupling | |
PerlMonks |
Selective string interpolationby ton (Friar) |
on Jun 29, 2001 at 03:30 UTC ( [id://92499]=perlquestion: print w/replies, xml ) | Need Help?? |
ton has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monks, I recently read through Jeffery Goff's excellent Parse::RecDescent tutorial. This inspired me to write my own context free grammar to parse the results of Data::Dumper, as eval-ing the structure is a huge security hole. I've got everything working except for escaped character interpolation on double-quoted strings (e.g. "\t", "\n"). In other words, I want to be able to convert the string '\t' into ASCII 9. Is there an easy way to do this other than writing regexs for every escape I want to catch? Please note that I do not want to use eval, as this would just reintroduce the security hole. I also do not want to do any kind of variable expansion. Thanks! -Ton
BTW: I realize that Data::Dumper dumps its strings in single quote mode. The interpolation is solely for completeness. :)
Back to
Seekers of Perl Wisdom
|
|