Member Rara Avis
You want to be very careful mixing quotation marks and apostrophes in Perl, Chris, because they have slightly different results. The quotation marks tell the interpreter to "expand" this string (including variables or function calls), while the apostrophe tells it to use the string EXACTLY as typed, without any expansion.
Should you try a few tests, Chris, I think you'll discover that quotation marks in HTML are only "necessary" when they enclose multiple words with spaces between each. Every browser I've tried will correctly display color=#ff0000, but will choke over alt=this is a test. Which makes sense, I think. When I'm debugging Perl scripts I often include temporary lines to print a variable's value at various stages, and I rarely bother with quotation marks when doing so.
However, when I'm writing production code, I always include the quotation marks, even though I know current browsers will work without them. The W3C standards call for the quotation marks and the next round of browsers just might enforce that standard. I'd hate to go back and change a ton of code, so feel it's safer to do it right the first time.
Fortunately, with Perl, there's several really easy solutions. You could change the pertinent line above to read:
print "Referring URL=<a href=\"$ReferringURL\">$ReferringURL</a>";
You could also use a HERE document to print the string:
Referring URL=<a href="$ReferringURL">$ReferringURL</a>
The HERE document is particularly good for printing large blocks of material. It essentially says, "start printing here" (the first HTMLCODE reference) and "stop printing here" (the second HTMLCODE reference). You can use any valid Perl name instead of HTMLCODE. By convention, programmers use all caps for HERE document names, but it's not required by Perl. Note that the first reference is terminated with the semicolon, but the second is not. The second reference also MUST start on a new line, in the left-most character position (no indenting allowed).
But, I've saved the best for last:
print qq(Referring URL=<a href="$ReferringURL">$ReferringURL</a> ) ;
print qq~Referring URL=<a href="$ReferringURL">$ReferringURL</a>~;
Using embedded delimiters is always a challenge. Perl has a reputation as usually providing multiple solutions to just about any problem - and I think this shows the reputation is well deserved.
<td>Referring URL=<a href="$ReferringURL">$ReferringURL</a></td>
Not only does Perl still understand the qq statement, but it will also output the line-breaks just as you entered them inside the qq delimiters, meaning a "view source" is a lot easier to read, too. This is only possible because Perl knows you ain't done until the semi-colon sings (groan).