in reply to Anon. array of refs to a range generated list of scalars.
In list context, it returns an list of values counting (up by ones) from the left value to the right value. If the left value is greater than the right value then it returns the empty array.
What is that "n" doing there? It seems "list" was once "array"... (update: the documentation for Perl 5.6 indeed says "array", I am quoting from the docs for 5.8) And shouldn't that last part be "the empty list"?
A couple of sentences later, it says:
In the current implementation, no temporary array is created when the range operator is used as the expression in foreach loops, but older versions of Perl might burn a lot of memory when you write something like this:for (1 .. 1_000_000) { # code }
This seems to suggest that when not used in for (foreach) a temporary array is created, which would explain a lot...
— Arien
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Anon. array of refs to a range generated list of scalars.
by jdporter (Paladin) on Jan 21, 2003 at 17:01 UTC |