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

Re: Legitimate use for combined 'local' and 'our'

by jettero (Monsignor)
on Nov 15, 2010 at 11:04 UTC ( #871446=note: print w/replies, xml ) Need Help??

in reply to Legitimate use for combined 'local' and 'our'

It may be that local doesn't do what you think it does. It would make a lot more sense to write something like this:
package blarg; use strict; use warnings; sub hrmph { our $global = "blarg"; print "$global\n"; local $global; $global = "hrm, just in here!"; print "$global\n"; # when this scope is done, global goes back to "blarg" automatical +ly }

Note that use vars is pretty much the same thing as our except that the package variable isn't bound locally to a sub as a pseudo-lexical. But if it was a case of use vars local would work the same way. It doesn't make the variable lexical, it makes the values you use in it local to the scope.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://871446]
[LanX]: IMHO 'ju' for 'u' happens in English where they can't pronounce the French u (or German )
[LanX]: and I'm sure I read that *hotel* used to be pronounced 'otel by the English upperclass
[Your Mother]: American English vowels are pretty lazy/mumbly in general.
[LanX]: talking about antisemitism, youtube automatic subtitles is entertaining shocking sometimes ... like when offering "Fruit Jews" as a drink
[Your Mother]: ...Come on you King of the Juice...
[Your Mother]: I actually know his kids.
LanX has to go/
[Your Mother]: King Herod's song (Mike D'Abo performed, I think)

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2017-03-27 17:18 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.