How am I able to access "foo" after calling DoSomething() in main
use warnings; use strict; my $aref = DoSomething(); print "$aref->[0]\n"; sub DoSomething { my @arr; push @arr, "foo"; return \@arr; } __END__ foo
In reply to Re: Why does Perl allow you to return array references to variables in local scope?
by toolic
in thread Why does Perl allow you to return array references to variables in local scope?
by MrSnrub
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |