A full URL? That's news to me. I use the following code. Looking at the code here, I may be using an ancient idiom that has since been superceded, but I offer it for completeness' sake.
use CGI qw/Link/;
my $q = new CGI;
print $q->header(),
$q->start_html({
-title => 'title of my page',
-head => Link({-rel=>'stylesheet', -type=>'text/css', -href=>'/fo
+o.css'}),
});
I sorta like this, because it reminds me just what exactly I'm asking the script to emit.
update: I typed the above code in from memory, and in the original incarnation, I wrote -href=>'foo.css'. I checked some production scripts, and what I do In Real Life is -href=>'/foo.css'. This is not a relative reference (correct me if I am wrong), in that I am not using -href=>'../foo.css' -- I guess you could say it's absolute on the current server.
I was taking issue with the explicit http://... I don't believe that that is necessary, and it makes it a smidgin easier to transfer the script from one host to another.
--g r i n d e r
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.