On Fri, Dec 28, 2001 at 11:21:04AM -0800, Mariana Añez wrote:
> 
> Hi 
>      How can i do a pipe program with perl? 
> I mean I want to make a program it can be used like this:
> > ls | myprogram | ps

Just take your input from STDIN and send your output to STDOUT, although
in general you won't need to do that explicitly.  eg.

while (<>)
{
    # process $_
    print ...
}

> Is using “open” the only way?

No, and it's probably not the best way either.

PS Piping to ps is generally fruitless ....

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to