in reply to formatting a checkbox label w/CGI.pm

I don't know what this is:
'<b val1 /b>'
..but it's definately not HTML. In any case, look into CGI.pm. I notice you have a few typos in your code as well:
%lables = ( 'key1 => '<b val1 /b>', ^ no closing quote 'key2 => '<b val2 /b> ); ^ missing ' ^ another one missing
You also indicate you're using the %labels hash, but you called it %lables in your example. As long as you are consistant with your misspelling of hash names, perl won't care, but if this was a mistake, you'll definately not get the results you want.

Replies are listed 'Best First'.
Re: Re: formatting a checkbox label w/CGI.pm
by mig (Initiate) on Jul 24, 2002 at 19:01 UTC
    Thanks for your response (podmaster and hacker). Sorry, I wasn't very careful proof-reading my code examples. I meant to use  <b> val1 </b> for the HTML example (and I constantly mispell the word labels, use strict; preserves my sanity when consulting the interpreter.)

    I tried to use $query->autoEscape(0) to instruct the CGI.pm module not to change the HTML codes in the labels hash, but it did not work. After a bit of investigating I discovered the web server I'm using, has CGI.pm v3.01 and apparently the autoescape function has been disabled in this version. I downloaded a copy of CGI.pm v2.81 from CPAN and modified the @INC array (at the beginning of my script) to pick up the older version. Now I'm getting the results I expect.

    thanks again for your help