On 6 July 2012 17:19, Eric Brine <ikegami@adaelis.com> wrote: > On Fri, Jul 6, 2012 at 4:30 AM, Linda W <perl-diddler@tlinx.org> wrote: >> >> 'my' has dynamic scope > > > No, it does not. Contrast with local which provides dynamic scoping: > >>perl -E"sub f { say $x } { my $x = 123; f() }" > >>perl -E"sub f { say $x } { local $x = 123; f() }" > 123 > > >> >> in the it goes away at end of the physical boundaries (sans any references >> to it). > > > Yes, that's called lexical scoping. or static scoping. Did you follow the > link I gave? > >> >> It also dynamically is created when you enter the physical boundaries of >> it's lexical scope. > > > Scope has nothing to do with where are variable is created. Scope is > entirely about where it's visible. > > You're also completely wrong about where and when it's created. A "my" > variable is created at run-tine, and either cleared or recreated on scope > *exit*. > >> >> It's a new var at that point. > > > Yes, > >> >> Such isn't true with state or our. > > > Not so. Equally new var there. A variable is an association between a name > and an address. "state", "our", and "my" equally create variables. our doesnt create anything. Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"Thread Previous | Thread Next