Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Cat multiple files into one pipe

by ehdonhon (Curate)
on Apr 25, 2003 at 04:09 UTC ( #253064=note: print w/replies, xml ) Need Help??


in reply to Re: Cat multiple files into one pipe
in thread Cat multiple files into one pipe

I'm piping http log files into wusage

My open command looks like this:

open ( SCRIPT, "| /usr/local/bin/wusage -c ${domain}.conf -l -" ) or d +ie $!;

Replies are listed 'Best First'.
Re: Re: Re: Cat multiple files into one pipe
by pzbagel (Chaplain) on Apr 25, 2003 at 04:28 UTC

    Question: If you manually cat those files together and pipe to your program, does it work. That is:

    cat /my/files/dir/* |/usr/local/bin/wusage etc...

    Let's see if this is the perl script that is in fact failing.

      I have a mixture of regular files and files that are gziped. I need to be able to pipe all of them to the program uncompressed. Using cat will not do that form. Unfortunately, unzipping them to the disk and then cat'ing them is not an option either.

        Isn't this what zcat is for?

        I don't see anything wrong with your code.

        If you kill the receiving program, SIGPIPE is the expected outcome. Is it exiting on its own? What makes you think it is no longer receiving data?

        The buffer size for pipes is quite small so Perl would quickly block if the receiving program stopped reading data (and even Perl's internal buffer is not that big).

                        - tye

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2022-05-22 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (80 votes). Check out past polls.

    Notices?