$ cat test.pl #!/usr/bin/perl use warnings; use strict; use CGI; use Data::Dumper; my $q = CGI->new; my %h = ( one => $q->param('one'), two => $q->param('two') ); print Dumper \%h; __END__ $ perl test.pl $VAR1 = { 'one' => 'two' }; $ perl test.pl one=1 Odd number of elements in hash assignment at test.pl line 11. $VAR1 = { 'one' => '1', 'two' => undef }; $ perl test.pl two=2 Odd number of elements in hash assignment at test.pl line 11. $VAR1 = { 'one' => 'two', '2' => undef }; $ perl test.pl one=1 two=2 $VAR1 = { 'one' => '1', 'two' => '2' };