SMOLNET PORTAL home about changes
#!/usr/pkg/bin/perl
#
use warnings;
use strict;

sub printlines {
    my $text = shift;
    my @lines = split(/\n/,$text);
    my $serv_string = "\tnull\ttext\t70";

    foreach (@lines) {

	my $tmpline = $_;
        $tmpline =~ s/\t/    /g;
        print "i$tmpline$serv_string\n";

    }

}

my $out = qx(/usr/pkg/bin/lynx -dump gopher://gopher.floodgap.com/0/groundhog/usa/forecast?ct%203);
my $dttime = $1 if ( $out =~ m{(^.+? (EST|EDT) .+$)}m );
printlines("Latest Weather Report for Tolland, CT Area\nAs of $dttime:\n ");
while ($out =~ m/^\.(.+?)\.{3}(.+?)\.\s*$/gms) {
  my $header = uc $1;
  my $body = lc $2;
  $body = ucfirst $body;
  printlines("$header:");
  printlines("$body\n ");
}

Response: text/plain
Original URLgopher://sdf.org/0/users/slugmax/code/wth.cgi.txt
Content-Typetext/plain; charset=utf-8