Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Declaring and checking content of variables with consecutive names

by AnomalousMonk (Bishop)
on Sep 23, 2016 at 17:23 UTC ( #1172478=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    c:\@Work\Perl\monks>perl -wMstrict -le
    "use Data::Dump qw(dd);
    ...
    ["", "foo", "", "", "bar", ""]
    
    indices of empty elements: 0 2 3 5
    
  2. or download this
    c:\@Work\Perl\monks>perl -wMstrict -le
    "use Data::Dump qw(dd);
    ...
    { "0" => "", "1" => "foo", "2" => "", "3" => "", "4" => "bar", "5" => 
    +"" }
    
    keys of empty values: 3 0 2 5
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2020-09-20 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (122 votes). Check out past polls.

    Notices?