Is there any significant differences between the two in terms of performance or memory usage?sub first_way { my @list; ... add elements to @list... \@list; } sub second_way { my @list; ... add elements to @list... [ @list ]; }
Are there any potentially adverse consequences of holding on to references to static lexical variables?
Update: replaced static with lexical
In reply to returning ref to static var vs. copying by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |