in reply to Why does Perl allow you to return array references to variables in local scope?
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
|
|---|