Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: sub returning undef

by adamk (Chaplain)
on May 24, 2004 at 21:54 UTC ( #356055=note: print w/replies, xml ) Need Help??


in reply to Re: Re: sub returning undef
in thread sub returning undef

Well, in the 'local' sense of local, I'm not sure. You should be using the 'local' keyword only to temporarily overload some global variable ( mainly anyway ).

In the 'my' sense, which is really 'lexical' I believe, no.

By returning by reference, you've added a second reference to the same data. The original dissapears, leaving you with 1 again. The data won't be nuked until you get to zero references to the data.

Replies are listed 'Best First'.
Re: Re: Re: Re: sub returning undef
by melora (Scribe) on May 31, 2004 at 19:48 UTC
    Ah, I see. Please forgive me; I'm still just beginning to learn about references. Thanks.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2021-12-03 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (29 votes). Check out past polls.

    Notices?