Click to See Complete Forum and Search --> : html code in .pl file


jasnjohn
09-25-2003, 11:34 PM
I just added a Guestbook from htmlgoodies perl tutorials, and the perl script that delivers the mail also prints a "thank you" message after the mail has been sent.

Is there any way to include in the "html" portion of the .pl script a link to another page?
Otherwise the user is left there in the middle of a perl script with no where to go. I'd like to give them the ability to move out back to the home page for example.

eg
print "<a href=......

I can see the inherant problem using the above as the href needs to be in "" which would close the text string.

Any other way of doing it?

Thanks,
John

Jeff Mott
09-26-2003, 12:35 AM
A couple ways. First, you can add a backslash before quotes in your HTML to tell Perl that the character should be treated literally rather than an operator.print "<a href=\"page.html\">";Or you can take advantage of the fact that Perl allows you to choose your quoting character with the q{} and qq{} constructs.print q[<a href="page.html">];See http://www.perldoc.com/perl5.8.0/pod/perlop.html#Quote-and-Quote-like-Operators for more details.

jasnjohn
09-26-2003, 03:42 AM
BINGO!

Many thanks for your help