in reply to Loading $_ as checkbox value when $_ has double quotes in its value

I'm surprised nobody has suggested using CGI.pm. CGI does the work so you have more time to drink beer! In this case, as well as catching typos like the one dws points out, it also handles the quoting problem. I think this does what you want:
#!/usr/bin/perl -w use strict; use CGI qw(:standard); $_ = 'I am a "Perl" Monk'; my $post_number = 5; print header, start_html, 'Delete This Post?', checkbox( -name => 'box' . $post_number, -value => $_, -label =>'', ), '<p>',$_,hr, end_html;
(You need the -label argument because the default is to print -name next to the box.)

Produces the following html (headers deleted for clarity) (although, of course, automatic header generation is part of the fun):
<head><title>Untitled Document</title></head><body> Delete This Post? <input type="checkbox" name="box5" value="I am a &quot;Perl&quot; Monk +" /> <p>I am a "Perl" Monk<hr></body></html></hr>


§ George Sherston

Replies are listed 'Best First'.
Re: Re: Loading $_ as checkbox value when $_ has double quotes in its value
by Fastolfe (Vicar) on Dec 04, 2001 at 22:01 UTC

    Definitely. Reason #1551 to use CGI or die;

    You can also consider putting the 'Delete This Post?' as the -label attribute for the checkbox. That's kind of what it's for.