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

Don't quote your output at all print "stuff";

Use a here document instead then you can put anything you fancy in it.

print <<HTML; Delete This Post? \n <input type=checkbox name="box$post_number" value=" $_ "<p +> $_<hr>\n<p>\n<br><br><br>\n|; HTML

Replies are listed 'Best First'.
Re: Re: Loading $_ as checkbox value when $_ has double quotes in its value
by andye (Curate) on Dec 04, 2001 at 16:34 UTC
    hakkr, afaiui that isn't the problem. The problem is that, if $_ contains doublequotes, then this
    $_ = qq|sheep go "baaa"|; print qq|<input value="$_">|;
    will output this:
    <input value="sheep go "baaaa"">
    where the value attribute = "sheep go" and "baaa"" is disregarded.

    That's my understanding - I could have the wrong end of the stick.
    andy.

      That's exactly the problem BUT it can be over come by simply using the regex solution twice, once to prepare the var for being a checkbox value and then reversing it to print the HTML back to the txt file. Dumpdadah! Yay!
      Thanks again and again guys! Where would I be without ya?
      jg
      _____________________________________________________
      If it gets a little bit out of hand sometimes, don't let it fool you into thinkin' you don't care.TvZ