in reply to Re^3: What's so bad about &function(...)?
in thread What's so bad about &function(...)?
You're half right, but you did miss something that jdporter missed, too.
@{\@foo} is, as far as I know, a truly useless elaboration of @foo.
The anonymous copy provided by @{[@foo]} is sometimes useful when you want to preserve @foo's contents. Example:
It helps with for loops, too. That kind of situation comes up surprisingly often and the copy is an effective and unobtrusive solution.my @mutant_foo = map { mutator($_) } @{[@foo]};
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: What's so bad about &function(...)?
by demerphq (Chancellor) on Dec 08, 2005 at 10:21 UTC | |
|
Re^5: What's so bad about &function(...)?
by jdporter (Paladin) on Dec 20, 2005 at 13:07 UTC | |
|
Re^5: What's so bad about &function(...)?
by Anonymous Monk on Dec 08, 2005 at 16:55 UTC |