in reply to Re^3: Possible useless use of map
in thread Possible useless use of map

Nope. C doesn't return arrays on the stack and neither does Perl.

I recommend: "Advanced Perl Programming" by Srinivsan as a good reference for those interested about Perl internals.

Replies are listed 'Best First'.
Re^5: Possible useless use of map
by Anonymous Monk on Mar 20, 2010 at 07:19 UTC
    Who said return? Besides, the memory penalty wasnt a memory leak, just memory that was allocated needlessly, then released.
      Once Perl has some memory, it never gives it back to the OS. Perl can reuse its memory and it is pretty smart about that. Writing to and using more memory is a penalty as that takes CPU Mips even if it doesn't take disk space.