Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: returning reference of a variable defined inside a subroutine.

by davido (Cardinal)
on Feb 04, 2019 at 06:20 UTC ( #1229325=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Devel::Peek qw(SvREFCNT);
    
    ...
    
    my $aref = return_array();
    print "Function returned a reference. Refcount:", Devel::Peek::SvREFCN
    +T(@$aref), "\n";
    
  2. or download this
    @array declared. Refcount: 1
    A reference has been taken to @array. Refcount: 2
    Function returned a reference. Refcount:1
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1229325]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2020-07-09 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?