New Post
In a typical web application the most frequently occurring task is to get parameters from a request. Perl community and popular frameworks have been having two interfaces to this: `param()` and `parameters()`. And there's a few issues. ### param() Good old has a convenient `param()` method, which behaves differently based on a context: my $q = CGI->new; my @keys = $q->param(); # get the list of param names my $name = $q->param('name'); # scalar context: always get single my @names = $q->param('name'); # list context: get multiple (if any) This is quite nice, since your code says *how you want values* by explicitly stating the context (whether a scalar context or a list context). The only place it bites... Continue »