I'm having trouble getting a piece of data from a form input to print in html. Here's the relevant portion of my code

sub subroutine {
my($hash) = shift;
my($data) = "$hash->{'expl'}";

print "Content-type: text/html\n\n";
print <<STOPHTML;
<div class="empdata">This employee has $data</div>
STOPHTML
}

The result is This employee has

When I try to print from a separate line like so,
print <<STOPHTML;
<div class="empdata">This employee has
STOPHTML
print "$data";
}

I either get a 500 error or the $data string is not there as in the first instance of code. Can someone help?



--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to