in reply to Why does Perl allow you to return array references to variables in local scope?
No. Perl is not C. The values are still in scope. This is a feature of Perl, enabled by using reference counting for values. Perl manages your memory for you so you don't need to allocate and free the memory manually.
The thing you're looking for is "references". If you come from a C background, "pointers" are a concept mostly similar, except where they differ. See References Quick Reference on how to work with references.
|
|---|