in reply to Re: Generating lists from a charset
in thread Generating lists from a charset

However, that's 238,328 elements. You might want to use glob in a scalar context

Unfortunately, using glob in a scalar context does not prevent it from pre-generating the entire list before giving you the first of them, so using it in a scalar context makes little or no difference to either the memory consumed, or the performance.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^3: Generating lists from a charset
by QM (Parson) on Dec 24, 2005 at 14:44 UTC
    You're right. Perhaps it's time for glob to be updated?

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      I've thought about that, but it is difficult to see how to make it an true iterator without changing the interface to return some kind of 'handle'?

      There is one other existing non-handle, scalar context iterator, each, and that is almost universally eshewed because of it's global nature.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        There is one other existing non-handle, scalar context iterator, each, and that is almost univerally eshewed because of it's global nature.
        Yes. Besides the explicit handles of things like readdir and readline, the only other one I can think of is m//g, which is another beast entirely. It does have an explicit handle of sorts though.

        -QM
        --
        Quantum Mechanics: The dreams stuff is made of