On Sat, Jun 26, 1999 at 11:17:00AM -0700, Vicki Brown wrote: > # Would you: > # 2) do an open with a pipe when you call the external command and attach > # the data to the filehandle, then iterate over <HANDLE> I'd do it this way, for several reasons (note that I'm not a Perl hacker and am probably getting this wrong): 1. Pipes are a nifty feature of UNIX, and we might as well use them as we've got them. (== It's *FUN*.) 2. It saves loading the entire output of the command into memory, which is good if your command is "find /" or something similar. 3. If you decide after reading a few lines that you don't need any more, you can close the pipe and the program will die without wasting runtime getting all the answers you didn't want. 4. It's the simplest way---only two commands (open, while) rather than needing to split results or write to a temporary file. If you care about performance *that* much, why are you using Perl? Of course, somebody else has probably profiled all the different methods... -- Adam Sampson azz@gnu.org ==== Want to unsubscribe from Fun With Perl? ==== Well, if you insist... Send mail with body "unsubscribe" to ==== fwp-request@technofile.org