Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Declaring with my, assigning, and testing in same line

by mordibity (Acolyte)
on Dec 11, 2015 at 14:41 UTC ( [id://1150034]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
     
      (my @v = keys %foo) == 1 or die "Got more than one: @v\n";
      print "V:@v\n";
    
  2. or download this
    Possible unintended interpolation of @v in string...
    Global symbol "@v" requires explicit package name...
    
  3. or download this
     my $x = parse_thing();
     my $y = $x->{item} or die "Item not found in x.\n";
     my @z; (@z = do_xyz()) < 3 or die "Got extra Z: @z\n";
     print "Z:@z\n";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found