in reply to Re: Why is @array so slow?
in thread Why is @array so slow?

I've been a bit busy the last couple of days, so I apologize for the late response. I just read perlop, and, if I may, I'd like to bounce my understanding of what is happening off of those more knowledgable.

When I pass anything beside a file handle or a simple scalar to the <> operator, it passes the stuff inside the operator to the glob function. I'd imagine globbing 6000+ elements is a bit slow.

What I don't understand is why japhy's example works. I would expect that it would try to glob (john jacob jingleheimer schmidt), not see anything like that in the directory, and evaluate to nothing. Oh well.<

Replies are listed 'Best First'.
Re: Re: Re: Why is @array so slow?
by dws (Chancellor) on Mar 01, 2002 at 00:20 UTC
    What I don't understand is why japhy's example works. I would expect that it would try to glob (john jacob jingleheimer schmidt), not see anything like that in the directory, and evaluate to nothing.

    glob() either mimics the shell or delegates to it for pattern expansion. Consider the difference between

    % echo foo foo %
    and
    % echo foo* echo: No match. %
    when there are no files begining with "foo" in the current directory.