Link to home
Start Free TrialLog in
Avatar of warrior32
warrior32Flag for Afghanistan

asked on

How to print html

How would I print out embedded html in perl.  For example this works

print <<EOF;
<html>
<head>
<title>My HTML page</title>
</head>
<body>
<br>
First Message to print out
<br>
Second message to print out
<br>
Third message to print
</body>
</html>
EOF

however I want to add an if statement to determine which message to print out.   I tried the following with no luck

print <<EOF;
<html>
<head>
<title>My HTML page</title>
</head>
<body>
<br>
EOF

if($test == 0){
print <<EOF;
First Message to print out
<br>
EOF
}
else{
print <<HTML;
Second message to print out
<br>
HTML
}
print <<HTML;
</body>
</html>
HTML



ASKER CERTIFIED SOLUTION
Avatar of FishMonger
FishMonger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There are other ways to do it, but what was unlucky about what you tried?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial