Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > how to use open with many input streams and capture output?

Reply
Thread Tools

how to use open with many input streams and capture output?

 
 
Pawel Banys
Guest
Posts: n/a
 
      07-08-2004
Hello,

There is an operation which can be performed at the shell prompt the
following way:

some_prg [some_inputfile_1] [some_inputfile_2] > result_file

However, before "some_prg" can use files, they have to be converted and it
can be done like this:

some_prg <(convert inputfile_1) <(convert inputfile_2) > result_file

It works perfectly at shell prompt.

I would like to start the above sequence in perl script using "open"
command:

open(SOME_OUTPUT,"some_prg <(convert inputfile_1) <(convert inputfile_2) |
");

When I try to run the script and capture SOME_OUTPUT, I get the following
error:

sh: -c: line 1: syntax error near unexpected token `('
sh: -c: line 1: `some_prg <(convert file_1) <(convert file_2)'

Is there any way to solve that syntax error without writing extra shell
scripts as I would like to have all the code in a single perl script?

Thank you for any help.

Pawel Banys



 
Reply With Quote
 
 
 
 
Joe Smith
Guest
Posts: n/a
 
      07-08-2004
Pawel Banys wrote:

> some_prg <(convert inputfile_1) <(convert inputfile_2) > result_file
>
> It works perfectly at shell prompt.


Which shell? That syntax is not valid for the /bin/sh (Bourne) shell,
which is what perl calls upon. For the Bourne shell, try this:

(convert inputfile_1; convert inputfile_2) | some_prog > result_file.

-Joe

P.S. Next time post to comp.lang.perl.misc, not comp.lang.perl .
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need addon to capture Media Player streams me@no.com Firefox 23 01-05-2008 10:40 PM
SuperVideoCap work as a broadcast capture and screen capture and record tool. hely0123 Media 0 10-30-2007 08:59 AM
Why do so many new style ansi streams and files etc, still use old style strings? Kza C++ 4 03-03-2006 07:00 PM
using input streams? Used with <x:transform>? spliffmonkey@iname.com Java 0 07-08-2005 10:26 PM
input streams, setw(), and strings vs. char*? Matthew David Hills C++ 1 09-05-2003 05:02 AM



Advertisments