Having just written code for handling selections of things for a recent job, I was curious about your code when I saw the posting. I took a different tact, though, but a few thoughts that might help.

First of all, my understanding of CGI.pm's handling of checkboxes is that if in your form you have a set of checkboxes named "boxes" such as <input type=checkbox name=boxes value="whatever" checked> , $q->param("boxes") returns a list of the values for the input boxes checked (including "whatever" for this one, unless unchecked). So you might do something like @todelete = $q->param("boxes"); then loop thru them.

Also, you might consider testing if $q->param("submit") is defined, then go from there, rather than seeing if any parameters are defined.

(I also posted a link to this response in your followup article, Shouldn't this return the named checkbox's value? )


In reply to Re: Re: Loading $_ as checkbox value when $_ has double quotes in its value by atcroft
in thread Loading $_ as checkbox value when $_ has double quotes in its value by jerrygarciuh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.