cbdoc has asked for the wisdom of the Perl Monks concerning the following question:
I have some Perl code that formats a bit of text ($string) then creates a file (foo.bar) which is then called by an executable from within Perl. The executable then outputs a stream which is fed into a Perl variable $output.
What I would like to know is how to skip the step of creating a temp file. The executable expects a file, but I suspect STDIN may be sufficient?
Thanks in advance for any help!
$filename = "foo.bar"; open(TMP_SEQ, ">$filename"); print TMP_SEQ ">$string"; $output = `executable -f foo.bar`
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling Command That Expects a File Without Creating a File
by NetWallah (Canon) on Apr 05, 2012 at 04:55 UTC | |
|
Re: Calling Command That Expects a File Without Creating a File
by mbethke (Hermit) on Apr 05, 2012 at 04:27 UTC | |
|
Re: Calling Command That Expects a File Without Creating a File
by Anonymous Monk on Apr 04, 2012 at 23:59 UTC |