Short: It's possible and legal.
It's non best-practice programming for languages like C, C++, etc.
where returning pointer to object from the stack is an error. But this is
Perl and Perl usually keeps track of the variables in use (ref-counts)
and garbage collects them when necessary.
There are edge-cases with cyclic dependencies though (see: weaken in Scalar::Util).
In reply to Re: Reference to a non-primitive (e.g. hash) local function variable is returned to the caller
by Perlbotics
in thread Reference to a non-primitive (e.g. hash) local function variable is returned to the caller
by o_ganot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |