Friday, April 24, 2015

perl: setting multiple hash values at once

perl -MData::Dumper -e '@{$h}{qw/toto tata/} = (34, 56); print Dumper $h;'              
$VAR1 = {
          'tata' => 56,
          'toto' => 34
        };