Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: Use of uninitialised value... but it is defined ?!

by dave_the_m (Monsignor)
on Mar 02, 2016 at 08:37 UTC ( [id://1156628]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Use of uninitialised value... but it is defined ?!
in thread Use of uninitialised value... but it is defined ?!

'my' has a compile-time and run-time action. The compile-time action is to place a new undef SV in the pad of the sub currently being compiled. This var is immediately available to be closed over when compiling any following subs or BEGIN blocks within the same scope.

At run time it pushes the current SV in the pad onto the args stack, and adds a note to free the SV on scope exit (and replace with a fresh new one).

An assignment, such as ..=1 happens at run time of course.

Dave.

Replies are listed 'Best First'.
Re^5: Use of uninitialised value... but it is defined ?!
by BrowserUk (Patriarch) on Mar 02, 2016 at 09:31 UTC

    Somehow, the first example seemed appropriate here :)


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-26 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found