#!/usr/local/bin/perl # # Quote Search Utility # (c)1996 Mark Rigby-Jones for mrjsw # mark.rigby-jones@keble.oxford.ac.uk # http://users.ox.ac.uk/~kebl0206/ # $query = $ENV{QUERY_STRING}; @query = split('=', $query); $query = $query[1]; $query =~ s/\+/ /g; $query =~ s/%(..)/pack("c",hex($1))/ge; print(< Babylon 5 Quote Search

<--

Babylon 5 Quote Search


BACK_TO_PERL $found = 0; $query =~ tr/[A-Z]\n'"`;:.,*/[a-z] /s; open(CNF, "out/quote.cnf"); chop($files = ); for ($i = 0; $i <= $files; $i++) { chop($file = ); open(FILE, $file); chop($quotes = ); for ($j = 0 ; $j <= $quotes; $j++) { $quote = ''; for ($k = 0; ($line = ) && ($line !~ /%%/); $k++) { $quote .= $line; } $check = $quote; $check =~ tr/[A-Z] \n'"`;:.,*/[a-z] /s; if ($check =~ /$query/) { $found++; print("
\n$quote
\n
\n"); } } } if ($found == 0) { print("

Sorry, no matching quotes were found.

\n"); } elsif ($found ==1) { print("

Just one matching quote was found.

\n"); } else { print("

$found matching quotes were found.

\n"); } open(COUNT, "out/count.search"); $count = ; close(COUNT); $count++; open(COUNT, "> count.search"); print(COUNT $count); close(COUNT); print(<

All original material ©The Oxford Babylon 5 Society
Babylon 5 and related material ©Warner Brothers
$count searches carried out since 3rd November 1995

BACK_TO_PERL