Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • The "order_date" would be handled by expecting parameters named "order_day", "order_month" and "order_year". How this is done internally is an example in the Class::CGI docs.

    Danger Will Robinson!

    I did that too. It hurt.

    It was after the second rewrite that I finally ended up with that namespacing and dot-seperators thing.


    order_date => 'Class::CGI::DateTime', ... should not break out of "order_date".

    Rather, what works really well is that it expects, order_date.month, order_date.year fie
    • I might addt that here's one way to support your dot syntax:

      package My::Handler::DateTime;
      use DateTime;

      sub new {
          my ($class, $cgi, $param) = @_;
          my @params = qw(day month year);
          if ('date' ne $param) {
              @params = map { "$param.$_" } @params;
          my ($day, $month, $year) = map { $cgi->raw_param($_) } @params;
          return DateTime->new(
              day   => $day,
              month => $month,
              year  => $year,

      It's really just that simple! That's why I'm really liking Class::CGI. You get a lot of flexibility with very little code.

      And what's a profile class?