XP is just a number | |
PerlMonks |
Re: Anon. array of refs to a range generated list of scalars.by Arien (Pilgrim) |
on Jan 19, 2003 at 14:47 UTC ( [id://228165]=note: print w/replies, xml ) | Need Help?? |
Says the manual about the range operator: 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: This seems to suggest that when not used in for (foreach) a temporary array is created, which would explain a lot... — Arien
In Section
Seekers of Perl Wisdom
|
|