Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Use of "my" after Perl v5.14

by marinersk (Priest)
on Sep 20, 2012 at 18:43 UTC ( #994772=note: print w/replies, xml ) Need Help??


in reply to Re: Use of "my" after Perl v5.14
in thread Use of "my" after Perl v5.14

Actually, I will confess to an atypical ignorance on the difference between "local" and "private" and will defer to the real Perl experts on this forum to answer your very appropriate question.

The point I was trying to make is that to make a variable which is global to a source file, you put the "my" outside all subroutine defintions, and that you could make a relatively localized variable which persists its value through the use of braces in what I believe is called "lexical scoping".

Regardless of the terms, the sample demonstrates a number of functionally distinct scope limits for your variables.

We should know the professional terms, but I, frankly, don't.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2018-12-16 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many stories does it take before you've heard them all?







    Results (70 votes). Check out past polls.

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