in reply to Puzzling CGI behavior
without having to resort to transitory variables. But, here is some code that uses Class::MethodMaker:my %webojb; $webobj{template} = param('template'); $webobj{minscale} = param('minscale');
Try running this code with the following argsuse strict; use warnings; use CGI qw(param); my $webobj = WebObj->new(); $webobj->template(param('template')); $webobj->minscale(param('minscale')); print $webobj->template,$/; print $webobj->minscale,$/; package WebObj; use strict; use warnings; use Class::MethodMaker new => 'new', get_set => [qw(template minscale)], ;
./webobj.cgi 'template=foo' ./webobj.cgi 'template=foo&minscale=bar' ./webobj.cgi 'template=foo&minscale=bar&minscale=baz'Personally, i wouldn't even bother with using %webobj unless i knew that it would need to be passed around a lot. I generally use HTML::Template as my 'object container', if you will. ;)
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|