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




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]
.



Relevant Pages

  • Submitting form via xmlhttp request
    ... Is there a relatively simple way of achieving the effect of this.form.submitbut sending the data via xmlhttp rather than doing the actual submit? ... I suspect I'd prefer a script library solution, such as jQuery or prototype, if only to free me from browser differences. ... I don't mind if I have to hardcode the method, or the action, but I'd like to avoid having to collect all the "items" that make up the form, if possible. ...
    (comp.lang.javascript)
  • Re: override the message of last login
    ... Atropo wrote: ... how can I avoid this message from being ... I'm guessing, but I suspect you mean the message that you see when you ...
    (comp.unix.shell)
  • Re: Penis Enlargement (on topic, uninteresting info ad)
    ... >*UKRMCers are more polite. ... I suspect someone would ask the room if they minded ... before doing the necessary (and probably take him outside to avoid ...
    (uk.rec.motorcycles.classic)
  • Re: Mini-review of a mini-ride
    ... trying to convince myself not to. ... I suspect I'll succeed. ... Given the stability issues, I think I'd avoid it. ...
    (uk.rec.motorcycles)
  • OT re Teledesic (Re: Magic Jack Latency Question)
    ... satellites, that would avoid this problem. ... I suspect the project died because it still had excessive latency, especially since they had to add an "internal" protocol to the network because the LEOs are not stationary in the sky. ...
    (alt.home.repair)