in reply to Re^3: What's so bad about &function(...)?
in thread What's so bad about &function(...)?
@{[@foo]} is really wrong, for the obvious reason that it copies the contents of @foo into a new (anonymous) array, so that, for example, splice( @{[@foo]}, 0, 5 ) does not modify @foo.
But why is @{\@foo} wrong? Whatever the answer is, the same could be said of &foo() (aside from the extremely tiny overhead of taking and dereffing a ref).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: What's so bad about &function(...)?
by Anonymous Monk on Dec 08, 2005 at 16:48 UTC |