Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Declaring with my, assigning, and testing in same line (scope)

by tye (Sage)
on Dec 11, 2015 at 14:56 UTC ( #1150039=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $x = 2;
    {
    ...
        # $x == 6
    }
    # $x == 2
    
  2. or download this
    (@$_ = keys %foo) == 1 or die "Got more than one: @$_\n" for \my @v;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2022-05-26 12:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (93 votes). Check out past polls.

    Notices?