🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.perl.misc
Article #33

Re: Help!! What's wrong by doing it this way in perl?

#33
From: Kevin Williams
Date: Thu, 03 Oct 1996 00:00
28 lines
1600 bytes
Raj Rangarajan wrote:
> 
> Hi,
>         I use the following command in perl to list all files in a directory
> including the ones in subdirectories:
> 
>         @files = `find $path -type f -print`;
> 
>         I know that the same can be accomplished by using the find2perl
> routine - I was just curious as the why the former was not used ? Is there
> anything that could potentially blow up by doing it the former way? Any help
> would be appreciated.  Please post your replies her or mail them to
> raj@netcarta.com
> 
> Thanks

The big difference is that by using find.pl, you get to process each
file as it 
is found, rather than waiting for the whole find command to finish and
then going 
through each of the files.

The other issue is that you end up storing a (potentially) huge array
when you
use the `find` method.

Kevin
Technical Details
Message-ID: <3253DE62.41C67EA6@f12sun1.oc.intel.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3252e804.0@netnews.netcarta.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fd3ff,e7e20359fd4007b5
X-Google-Attributes: gidfd3ff,public
X-Google-Thread: fa0ae,e7e20359fd4007b5
X-Google-Attributes: gidfa0ae,public
From: Kevin Williams <williams@f12sun1.oc.intel.com>
Subject: Re: Help!! What's wrong by doing it this way in perl?
Date: 1996/10/03
Message-ID: <3253DE62.41C67EA6@f12sun1.oc.intel.com>
X-Deja-AN: 186958491
distribution: world
references: <3252e804.0@netnews.netcarta.com>
to: Raj Rangarajan <raj@netcarta.com>
content-type: text/plain; charset=us-ascii
organization: Intel Corporation, Chandler, AZ
mime-version: 1.0
newsgroups: comp.lang.perl.misc,ba.transportation
x-mailer: Mozilla 3.0 (X11; I; SunOS 4.1.3_U1 sun4m)