in reply to Template Parsing

This code has problems. The biggest one is that it is using global variables to pass things around between subs. This is a very messy and error-prone style. I would strongly encourage you to "use strict" and -w and to use explicitly passed variables with your subs. For example: my $weather_template = weather(); Your loading of files would be more efficient if you slurp them up like this:
{ local $/; open(MYFOOT,"<$foot"); my $weather_template = <MYFOOT>; close(MYFOOT); }
If this simple replace is really enough for your template, then go with it. However, if you see any need for fancier constructs like loops and conditionals, please try using a module from CPAN for it.

You don't really provide enough information to determine why you are seeing code in the browser (HTML code? Perl code?), but I don't see you printing a header before sending this content. You may also have your web server or permissions set up wrong, preventing it from executing your code.