Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
- From: Ben Morrow <ben@xxxxxxxxxxxx>
- Date: Sun, 29 Jun 2008 18:44:00 +0100
Quoth xhoster@xxxxxxxxx:
Ben Morrow <ben@xxxxxxxxxxxx> wrote:
You can avoid pre-creating the list by using 'while' instead:
while (my $file = </home/*/.forward>) {
On my system, and I suspect on all systems, this still pre-creates the
result set in its entirety.
You're right. From File::Glob::csh_glob:
| # if we're just beginning, do it all first
| if ($iter{$cxix} == 0) {
| if (@pat) {
| $entries{$cxix} = [ map { doglob($_, $DEFAULT_FLAGS) } @pat ];
| }
| else {
| $entries{$cxix} = [ doglob($pat, $DEFAULT_FLAGS) ];
| }
| }
so it builds the whole list on the first call, regardless. I guess this
is because doglob sorts the list before returning it.
Ben
--
"Faith has you at a disadvantage, Buffy."
"'Cause I'm not crazy, or 'cause I don't kill people?"
"Both, actually."
[ben@xxxxxxxxxxxx]
.
- References:
- 'nobody' using sudo -- scary!
- From: Johnny
- how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
- From: nntpman68
- Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
- From: Ben Morrow
- Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
- From: xhoster
- 'nobody' using sudo -- scary!
- Prev by Date: FAQ 9.2 My CGI script runs from the command line but not the browser. (500 Server Error)
- Next by Date: Re: Need help with a question.
- Previous by thread: Re: how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)
- Next by thread: Re: 'nobody' using sudo -- scary!
- Index(es):
Relevant Pages
|