perl -MData::Dumper -we "while(my $k=shift @ARGV and $v = shift @ARGV ){$h{$k}=$v};print Dumper \
%h" 1 a 2 b ODD
$VAR1 = {
'1' => 'a',
'2' => 'b'
};
####
perl -MData::Dumper -we "my $k; while($k=shift @ARGV and $v = shift @ARGV ){$h{$k}=$v};$h{$k}= undef unless exists $h{$k}; print Dumper \%h " 1 a 2 b ODD
$VAR1 = {
'1' => 'a',
'ODD' => undef,
'2' => 'b'
};
####
perl -MData::Dumper -e "while($k=shift @ARGV and $v = shift @ARGV ){$h{$k}=$v};if($k and !$v){$h{$k}=undef}print Dumper \%h " 1 a 2 b ODD
$VAR1 = {
'1' => 'a',
'ODD' => undef,
'2' => 'b'
};