> '<>' is magical, it will loop over lines that are passed in, and when
> files are supplied on the command line, they are opened and looped
> through as well. It's an ever so handy feature. Plus, it's low on
> memory.
Yes! Thank you Casey, that was exactly what I was looking for!
- Bryan
Try something like
open (PIPE, "awk '{print $1}' somefile");
and just run the perl script.
-Michael
>>> Bryan Harris <[EMAIL PROTECTED]> 02/21/03 02:41PM >>>
I'm writing a simple script (qstat) to sum, count, and average whatever
stream of numbers the user throws at it.
It loops through @ARGV
It was Friday, February 21, 2003 when Bryan Harris took the soap box, saying:
:
: I'm writing a simple script (qstat) to sum, count, and average whatever stream of
numbers the user throws at it.
:
: It loops through @ARGV reading files, so it works fine if I say:
:
: qstat somefile someotherf
If you are piping then try this :
@piped_in = <>;
foreach $line(@piped_in) {...
> -Original Message-
> From: Bryan Harris [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 21, 2003 2:42 PM
> To: [EMAIL PROTECTED]
> Subject: reading from a pipe
>
>
>
> I'm writing a simple script (qs