is the example below which I got from internet correct? My doubt is - when subroutine scope is lost,@array no more remains valid.Hence returning its reference does make any sense ? Please help .
sub return_array { my @array = (1, 2, 3); foreach my $element (@array) { calculate($element); } return \@array; }
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |