[Bioperl-l] how to use pipe in perl script?

Paulo Almeida paulo.david at netvisao.pt
Mon Apr 19 07:30:48 EDT 2004


You can use the 'system' command to do something like this:

system("program1 -infile filename | program2");

If that doesn't work for some reason, you could write the output of the 
first program to a file, and then open it with the second program.

system("program1 -infile filename > output");
system ("program2 < output");

I hope that's what you wanted, I'm not sure I understood...
-Paulo Almeida

Zhou Yu wrote:

> Hi,
>
> How to use pipe in a script, like redirecting the output of a program 
> to another program in a script?
>
> For example, I use this command "program1 -infile filename | program2" 
> in the command line, and how can I to do this in a script?
>
> Thanks!
> *
> Yu Zhou*
>



More information about the Bioperl-l mailing list