swartz has asked for the wisdom of the Perl Monks concerning the following question:
I'm interested in creating a "watered down" Perl environment for web developers. Developers would be able to embed a certain safe subset of Perl in their HTML - the basic control and data structures, without the eval, file I/O, system commands, backticks, etc.
The closest thing I've found, naturally, is the Safe module. I've tried gamely to use it, but it presents a host of problems when used with Mason (and, I expect, other templating systems.) One of the major problems is that once you're inside the safe compartment, everything you call out to (such as useful CPAN modules) is restricted by safe as well.
What I want, instead, is just a black box that I can hand a piece of Perl code and have it say "yes" or "no" indicating whether it is a safe subset of Perl according to my definition in the grammar. Inputs to this black box would, of course, have to include a full list of allowed function and package names.
I'm aware of the great difficulty of trying to parse Perl in its fullness, and I would be willing to sacrafice a fair amount of functionality and syntax in order to get to an actual usable grammar.
Thanks for any advice and pointers.
Jon
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: A grammar for Perl, or something close
by Zaxo (Archbishop) on Nov 15, 2003 at 00:45 UTC | |
Re: A grammar for Perl, or something close
by rob_au (Abbot) on Nov 15, 2003 at 02:10 UTC | |
Re: A grammar for Perl, or something close
by bart (Canon) on Nov 15, 2003 at 00:40 UTC | |
•Re: A grammar for Perl, or something close
by merlyn (Sage) on Nov 15, 2003 at 15:11 UTC | |
Re: A grammar for Perl, or something close
by chromatic (Archbishop) on Nov 15, 2003 at 01:59 UTC | |
Re: A grammar for Perl, or something close
by BUU (Prior) on Nov 15, 2003 at 04:10 UTC | |
Re: A grammar for Perl, or something close
by Chady (Priest) on Nov 15, 2003 at 11:37 UTC | |
by jordanh (Chaplain) on Nov 15, 2003 at 16:45 UTC | |
Re: A grammar for Perl, or something close
by Arrowhead (Monk) on Nov 17, 2003 at 14:57 UTC |