On Tue, 7 Sep 2004, Francesco del Vecchio wrote:
I've got a weird problem using an external program that get the input from "stardard input"
I've got to call it (and easily do this with "system('myprogramname')" but I've to feed this program with an XML file that generally is passed via standard input with a "filename | myprogramname" in the shell, but in my case it is in a variable of my perl program
How can I do it without write a file on the filesystem?
One way to do this -- probably not a good one -- might be
system("echo $xml | myprogamname")
but if there's anything in the XML that the shell finds interesting, this could fail in all kinds of spectacular ways.
Is writing it to a temp file out of the question? It seems like that would be a lot more robust, as then you could just do
system("myprogramname < $temp_xml_file")
and you should be much safer from invalid data problems in the shell.
-- Chris Devers
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>