Listing 1: First Version of Apache::TagNew

package Apache::TagNew;
use strict;
use Apache::Constants qw(OK DECLINED NOT_FOUND);
sub handler {
    # Get the Apache request object
    my $r = shift;
    # Only handle text/html files
    return DECLINED unless ($r->content_type
    eq "text/html");
    # Get the file we're trying to send
    if (open(FILE, $r->filename))
   # Send an appropriate MIME header
   # Slurp up files at once
   undef $/;
        # Grab the file's contents
   my ($contents) = (<FILE>);
   # Tag hyperlinks as new
   $contents =~ s|</a>|</a><font
   # Print the contents
        # Close the file handle
   close FILE;
   # Indicate that all went well
        return OK;
    # produce an appropriate error message
        return NOT_FOUND;