# Derive the template's filename from all characters in the # requested URI # after the last /, making sure we only allow word characters $url =~ m!/(\w)$!; my $template_filename = $1 or return DECLINED; my $template = HTML::Template->new(filename => $template_filename) or return SERVER_ERROR; if ($template_filename eq 'results') { # Write some code to generate a list of results and set # corresponsing parameters on $template } elsif ($template_filename eq 'weather') { # Write some code to find out what the weather is like and set # template parameters } elsif ($template_filename eq 'users' or $template_filename eq 'people') { # Write some code to generate a list of users on the site and # set some template parameters } #### if ($template->query(name => 'temperature' or $template->query(name => 'cloud_cover') { # The code to find out what the weather is like goes here } #### my %param= map($_ => 1) $template->query(); if (exists $param{'temperature'} or exists $param{'cloud_cover'}) { # The weather code goes here }