I do absolutely understand that feeling of "oh hell, I can't be bothered with this" that one gets when one Reads The Fine Manual... after all, the following sentence is scarcely written for the benefit of people who don't already pretty much know the score:
The optional fifth argument is a pointer to an associative array relating the checkbox values to the user-visible labels that will be printed next to them (-labels).
BUT... it is SO worthwhile getting through the pain barrier. It's seldom as tough as it looks, and once learned it saves time after time.

Where it says
a pointer to an associative array relating the checkbox values to the user-visible labels
what it means is "set up a hash where the keys are what you want as the checkbox values, and the values are what you want the user to read" - i.e. something like:
my %checkbox_items = ( a => 'BillJ may have been assigned as trustee to the security obje +ct which gives him supervisor rights over all NDS objects', b => 'BillJ may be wearing pink pyjamas when he comes round the mo +untain', c => 'BillJ may be the first man to orbit Mars on a unicycle', d => 'BillJ may be just another Perl hacker', );
Now, to avoid confusion, you should probably construct your array of checkbox values from this hash - that way you're sure there's always going to be a match between the values and the labels. So do
my @checkbox_values = keys %checkbox_items;
Then you put it all together by adding the -labels argument when you call the checkbox_group method:
print start_html, checkbox_group( -name => 'testing', -values => \@checkbox_values, -linebreak => 1, -labels => \%checkbox_items, ),
And this will print out the following HTML (line breaks added for clarity:
<input type="checkbox" name="testing" value="a" /> BillJ may have been assigned as trustee to the security object which g +ives him supervisor rights over all NDS objects <br /> <input type="checkbox" name="testing" value="b" /> BillJ may be wearing pink pyjamas when he comes round the mountain <br /> <input type="checkbox" name="testing" value="c" /> BillJ may be the first man to orbit Mars on a unicycle <br /> <input type="checkbox" name="testing" value="d" /> BillJ may be just another Perl hacker <br />
Hope that does what you want to do in an intelligible way. One other thought - about saving memory. A point frequently made round here, for example by by dragonchild, is that Perl is optimised not for CPU or memory use, but for that scarcest and most valuable of computer consumables... developer time. I.e. YOUR time. So if a thing is quicker to write but slower to run, write it that way and then $RAM->buy('more');

§ George Sherston

In reply to Re: Re: Re: Re: Checkbox values by George_Sherston
in thread Checkbox values by chriso

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.