http://www.perlmonks.org?node_id=833145


in reply to Re^2: Hash of Regex
in thread Hash of Regex

Why / how did this
my %dict = ( 'brown' => 'yellow', () => 'int', () => 'float', );
become this??
my %dict = ( 'brown' => 'yellow', 'int' => 'float', );

Replies are listed 'Best First'.
Re^4: Hash of Regex
by LanX (Saint) on Apr 06, 2010 at 22:56 UTC
    For Perl => is just a comma, and empty lists () are ignored when flattening lists.

    perl -e' @a=(1,2,(),(),3);print "@a"' 1 2 3

    Cheers Rolf

Re^4: Hash of Regex
by almut (Canon) on Apr 06, 2010 at 22:56 UTC

    Empty elements (lists) in a list collapse,  e.g. (1, (), 2, 3, (), (), 4) is the same as (1, 2, 3, 4).