in reply to Re: Re: Puzzling CGI behavior
in thread Puzzling CGI behavior

that comma after param('template') should tell it to lay off of 'minscale'.

It doesn't, though. merlyn has the right of it, as usual. There are no parameters. Calling param() in list context (as happens in the hash assignment) produces an empty list in this case. Since there has to be a value, Perl grabs the next one in a list.

Your snippet is equivalent to:

my %webobj = ( 'template', param( 'template' ), 'minscale', param( 'minscale' ), );

Consider what happens if you assign an empty list:

use strict; use Data::Dumper; my %hash = ( foo => ,,, bar => 1 => 'baz' ); print Dumper \%hash;