Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 studying the Monastery: (6)
As of 2019-06-19 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (88 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!