What happens when a reference to a non-primitive (e.g. hash) local function variable declared as "my $x" is returned to the caller?
Does perl know to handle this non-best practice programming and keep its reference count, or does the var's memory gets released when leaving the function (i.e. from the function's stack)?
Exmaple:
sub x
{
my %some_hash;
# Manipulate %some_hash
return \%some_hash;
}