#!/usr/bin/perl print "Content-type: text/html\n\n" ; print "Guestbook

\n" ; print "\n" ; $get_vars = $ENV{'QUERY_STRING'} ; $get_vars =~ tr/+/ / ; $get_vars =~ s/%(..)/pack("c", hex($1))/ge ; @array = split(/&/, $get_vars) ; $leng = scalar(@array) ; # number of name/val pairs sent for ($i = 0 ; $i < $leng ; $i++) { $array[$i] =~ /([^=]+)=(.*)/s ; # /s treats string as one line $namevals{$1} = $2 ; } print "

\n" ; print qq!

The Guestbook

\n! ; print "

\n" ; print "

" ; $start = $namevals{"start"} ; open(GB, "/home/html/GB/midi_gb.raw") ; OUTER1: for ($i = 0; $i < $start ; ++$i) { # read records until we hit the $start-th one - keep in mind # there's an extra delimiter to skip over. while () { next OUTER1 if (/^myhopefullyuniquedelimiter$/) ; } last ; } if ($start == 0) ; # get past delimiter OUTER2: for ($i = 1; $i <= 5; ++$i) { print "
\n" ; while () { next OUTER2 if (/^myhopefullyuniquedelimiter$/) ; print ; } print "
\n

No more entries

\n" ; $done = 1 ; last; } unless ($done) { $start += 5 ; print "\n" ; print "" ; } print "
\n" ; print "Back to the Classical Midi with Words Page
\n" ; print "\n" ; close(GB) ;