Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: what is the scope of my $x=$x

by Joost (Canon)
on Jun 05, 2006 at 10:45 UTC ( [id://553564]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 09:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found