Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 about the Monastery: (6)
As of 2019-09-19 02:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (238 votes). Check out past polls.

    Notices?