internet_pixie has asked for the wisdom of the Perl Monks concerning the following question:
Appologies for the pun, but as it happens that is my question.
I am writing a Perl application whose default output is XML. What I would like is to provide an extensible feature that allows the user to process this XML.
The use of shell's | is not applicable as multiple XML outputs are possible in a single run (for each command arg there is a XML output).
My initial thought was to pass the path to a Perl script as an arg to my Perl script and then do() the users Perl script. However that doesn't work. I want the code to be executed, not evaluated.
I've thought about using exec(). But I'm not sure that passing a multiline string (that could be 1000's of lines long) is a Good Thing (TM). Nor am I aware of a way of passing a Perl object via the shell.
So I throw this open to you wise brethren. How do I get my Perl script to execute a user provided code given via a command line argument?
Cheers
Internet Pixie
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: should I do() this?
by Joost (Canon) on Aug 19, 2005 at 10:37 UTC | |
|
Re: should I do() this?
by saberworks (Curate) on Aug 19, 2005 at 17:55 UTC |