How am I able to access "foo" after calling DoSomething() in main if I am only returning a reference? Shouldn't the values in the array be out of scope at that point?sub DoSomething { my @arr; push @arr, "foo"; return \@arr; }
In reply to Why does Perl allow you to return array references to variables in local scope? by MrSnrub
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |