in reply to a Perl question

When you use CGI.pm, beware that if you use multiple checkboxes with the same name (like you do in your example), you will have to split the resulting scalar on the "\0".
If you only checked one of them, you can safely use the result as a scalar, but if multiple boxes are checked, you can get the seperate values by splitting them...

Update Of course -as always- merlyn is right. I'm totally wrong here... :( HTH,

Jouke Visser, Perl 'Adept'

Replies are listed 'Best First'.
RE: Re: a Perl question
by merlyn (Sage) on Aug 29, 2000 at 15:51 UTC
    You seem to have CGI.pm and that old decrepit cgi-lib.pl confused.

    CGI.pm is just fine with multiple checkboxes:

    @selections = param("state");
    In a scalar context, param returns the first selection it sees. In a list context, it returns the entire list of selections. At no time does anything come back with a NUL separator.

    -- Randal L. Schwartz, Perl hacker

      I'm begging for your absolution :-|

      Jouke Visser, Perl 'Adept'