in reply to what is the scope of my $x=$x

The first $x is lexical, the second one is global.

Replies are listed 'Best First'.
Re^2: what is the scope of my $x=$x
by BrowserUk (Patriarch) on Jun 05, 2006 at 10:52 UTC

    Probably, but it could also be

    sub routine{ my $x = 123; print $x; ## 123 if( 1 ) { my $x = $x; ## Snippet here $x /= 2; print $x; ## 61.5 do { my $x = $x; ## Or here $x *= 10; print $x; ## 615 }; print $x; ## 61.5 } print $x; ## 123 }

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.