How do I make a custom icon show up in the address bar when a user loads a page?
You mean, in Safari?
It's a file at the root of your site, called favicon.ico. It's a 16x16 icon in Windows Icon (.ico) format, which is exportable from a number of graphics packages.
If you want to use Perl to create one, you might have a look at PerlMagick. This being a Perl group, I felt obligated to give a Perl-ish answer... ;-)
sherm--