Re: CGI.pm

[prev] [thread] [next] [lurker] [Date index for 2006/06/27]

From: A. Pagaltzis
Subject: Re: CGI.pm
Date: 20:16 on 27 Jun 2006
* Peter da Silva <peter@xxxxxxx.xxx> [2006-06-27 21:05]:
> Well, hmmm...
> 
>   puts [hidden "field_name" $field_value override 1]
> ==>   <input type=hidden name="field_name" value="$field_value" override=1>
> 
> Can you write the Perl similarly?
> 
>   print hidden('field_name', "$field_value", -override => 1);
> 
> Or is this really Perl hate?

There's no language-level support for such use. The arrow is just
a special-cased comma -- it doesn't create pairs or anything like
that. (I'm not sure how your example gets parsed as it should,
either.) However, it'd be pretty trivial to offer something very
close to your suggestion, eg.:

    print hidden 'field_name', $field_value, { -override => 1 };

CGI.pm doesn't.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>;
There's stuff above here

Generated at 21:00 on 05 Jul 2006 by mariachi 0.52