Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: detecting a pipeline on STDIN

by dakkar (Hermit)
on Mar 16, 2003 at 18:14 UTC ( #243499=note: print w/replies, xml ) Need Help??


in reply to detecting a pipeline on STDIN

You say:

using this loop without knowing there is a pipeline will cause the program to hang till it gets an EOF on STDIN (which it obviously won't get).

Duh? This:

ls|perl -e 'while (<STDIN>) {/1/ and do{print}}'

works as expected (prints only the lines of the output of ls which contain a 1). OK, you need to do different processing in the case of a pipeline, but you will still get EOF.

Just nitpicking...

-- 
        dakkar - Mobilis in mobile

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://243499]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-05-22 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?