slifox has asked for the wisdom of the Perl Monks concerning the following question:
Thanks!open(TCPIN, "/usr/sbin/tcpdump -n -p tcp |"); while (1) { # Method 1 die "Aiii! $!" if !sysread(TCPIN, $_, 1024); # Method 2 $_ = <TCPIN>; # Of course, both of these methods aren't used at the same time! # Parsing stuff here (this is really fast, so the problem isn't here) }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Very fast reads from an external program
by MarkM (Curate) on Apr 25, 2003 at 03:16 UTC | |
by Abigail-II (Bishop) on Apr 25, 2003 at 07:31 UTC | |
by MarkM (Curate) on Apr 26, 2003 at 03:45 UTC | |
|
Re: Very fast reads from an external program
by zengargoyle (Deacon) on Apr 25, 2003 at 04:06 UTC | |
|
Re: Very fast reads from an external program
by TVSET (Chaplain) on Apr 25, 2003 at 13:47 UTC | |
by slifox (Acolyte) on Apr 25, 2003 at 21:40 UTC | |
by TVSET (Chaplain) on Apr 26, 2003 at 00:04 UTC |