Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)



Ben Morrow <ben@xxxxxxxxxxxx> wrote:
Quoth "John W. Krahn" <jwkrahn@xxxxxxx>:
Joe Smith wrote:
Hans Mulder wrote:

If you really don't want to have the whole list in memory, you'll
have to roll your own glob using readdir. Something like:

opendir HOMES, "/home" or die Can't read /home: $!";
while (my $entry = readdir(HOMES)) {

The first call to readdir() in scalar context will read the entire
list into memory

No it won't.

(deja vu anyone?) Yes it will.

No it won't.

We have now switched from glob to readdir. Different functions,
different behaviors. (I missed that transition myself at first.)

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
.



Relevant Pages