Fayland Lam wrote:
code as follows:

sub test : Local {
   my ($self, $c) = @_;
     my $test = {
       a => $c->req->param('a'),
       b => $c->req->param('b'),
       c => $c->req->param('c'),
   };
   $c->res->body(Dumper(\$test));
}



well, this is OK

sub test : Local {
    my ($self, $c) = @_;

    my $test = {
        a => $c->req->params->{'a'},
        b => $c->req->params->{'b'},
        c => $c->req->params->{'c'},
    };
    $c->res->body(Dumper(\$test));
}


when visit as test?b=1
it shows

$VAR1 = \{
           '1' => 'c',
           'a' => 'b'
         };


hmm, a trap I think. need use $c->req->param('a') || ''. something not so good.



--
Fayland Lam // http://www.fayland.org/
Foorum based on Catalyst // http://www.foorumbbs.com/

_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to