favicon in Perl CGI module

Hi,

I'm writing a CGI script in Perl using the CGI module (CGI - perldoc.perl.org), and I can't find the exact syntax to add a reference to my favicon .ico file in the <head>. Any insights?

Thanks.

You don't do it that way. You simply put favicon.ico on the server in the top-level directory of the virtualhost's DocumentRoot. The web *browser* will try to get it by default.

I actually don't have access in this case. I am working only with a single subdirecory. I read somewhere that you can override the default top-level favicon, but I can't figure out how.

Favicon is requested on the client side, its either there or its not there.

Ok, according to wikipedia, sourced from W3C,

So just add this in your CGI output AFTER the <HEAD> opening tag and BEFORE the </HEAD> closing tag.

So in PerlCGI, you would so something like this:

 print start_html(-head=>[ 
              Link({-rel=>'icon',-type=>'image/png',-href=>'favicon.ico'}),
 ]);