perl5ever has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: returning ref to static var vs. copying
by JavaFan (Canon) on Jun 09, 2009 at 23:41 UTC | |
by perl5ever (Pilgrim) on Jun 10, 2009 at 15:00 UTC | |
by JavaFan (Canon) on Jun 10, 2009 at 15:09 UTC | |
by afoken (Chancellor) on Jun 11, 2009 at 11:04 UTC | |
|
Re: returning ref to static var vs. copying
by shmem (Chancellor) on Jun 10, 2009 at 00:06 UTC | |
by ikegami (Patriarch) on Jun 10, 2009 at 15:17 UTC | |
by Porculus (Hermit) on Jun 10, 2009 at 22:13 UTC | |
by ikegami (Patriarch) on Jun 11, 2009 at 06:37 UTC | |
|
Re: returning ref to static var vs. copying
by trwww (Priest) on Jun 11, 2009 at 05:21 UTC | |
by ikegami (Patriarch) on Jun 11, 2009 at 06:39 UTC |