begood321 has asked for the wisdom of the Perl Monks concerning the following question:

#!/usr/local/bin/perl -w use strict; use CGI qw(:standard); # Include standard HTML and CGI +functions use CGI::Carp qw(fatalsToBrowser); # Send error messages to b +rowser my @foodmenu = ['Pizza','Garlic Bread','Apple Pie','Ice Cream']; &printheader; if (param()) { &displayorder; } &printform(@foodmenu); &printtail; sub printheader { print header(), start_html(-title=>"Pizza Order Form", -bgcolor=>"#00CCFF"), h1("Mikey's Pizza Delivery Service"), hr; } sub printtail { print address("pizzaman\@pizza.co.uk"), end_html(); } sub printform { my $foodchoices = $_[0]; print h1("Order your food here"), start_form(), "What's your name? ", textfield("name"), p, "What's your phone? ", textfield("phone"), p, "Food order? ", checkbox_group(-name=>'food', -values=>\@$foodchoices, -columns=>2, -multiple=>'true'), p, submit("Submit form"), reset("Clear form"), end_form(); } sub displayorder { print h1("You have ordered..."); print "<UL>"; foreach my $key (param) { my @values = param($key); print "<LI><B>$key:</B> "; print join(", ",@values),"</LI>\n"; } print "</UL><HR>"; }

gives me this error message / Software error: Malformed multipart POST

Hello fellow monks, I'm trying to submit 1 or multiple values to be shown in displayorder subroutine

I also tried setting values from food array in printform subroutine directly but still getting error above. However, my preference is the array solution from within printform sub as stated in code presently because I'm getting lots of values where I need to provide checkboxes for user selection choices. Any help is greatly appreciated, thanks

Replies are listed 'Best First'.
Re: Perl CGI checkbox_group submit error
by daxim (Curate) on Jul 15, 2013 at 17:13 UTC
    I cannot reproduce your problem, the program works - despite looking as if it had time-travelled to here from the last millenium - just fine for me no matter what I submit.
      Thanks for your reply. Yes I know code is from way back when :). I'm just using this code to test on server beore implementing in real code. Code looked fine to me too, so it appears to be a server issue or configuration. I will try to update the CGI.pm which is currently $CGI::VERSION='3.00';. Can you let me know which version you using? I will try to get latest version.
Re: Perl CGI checkbox_group submit error
by poj (Abbot) on Jul 15, 2013 at 18:03 UTC
    Program works fine for me too. You could try overriding the default ;
    start_form( -enctype=>CGI::URL_ENCODED ),
    poj

      Thanks poj tried your suggestion but got same error, so I think the version of CGI.pm could be the problem. I will try getting latest update, which version of CGI.pm you using?

        I'm using 3.59.
        poj