uppose you have a subroutine which returns an array ref. There are basically two ways to do it:
Theres another way. Instead of making an @array, always use an array ref:
sub third_way { my $array_ref = []; ... add elements to $array_ref... $array_ref; }
regards,
In reply to Re: returning ref to static var vs. copying
by trwww
in thread returning ref to static var vs. copying
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |