[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[gopher] First shot at a gopher mole - results vary, but why?



Hi all,  

I've knocked up a quick script - gopher mole - as the possible basis for a 
database search tool.  Please note that there's no attempt at sanitising 
user input yet ;-) it's called as a type '7’.

I've found that it works fine with Mac Camino and the gopherproxy.meulie.net 
but not with iGopher on the iPad or the Floodgap.com proxy.  When it 
"doesn't work", it only displays the link back to my main gopher page. 

Here's the script.. Any advice welcome!

#!/usr/bin/perl
require "gopherlib.pl";
&return_error($0, "wasn't given sufficient arguments! @ARGV") 
  if (!scalar(@ARGV));
use Env qw{ REMOTE_HOST REMOTE_ADDR SERVER_PORT 
 SELECTOR REQUEST };
print STDOUT "iHELLO user \n";
print STDOUT "iRemote Host: $REMOTE_HOST \n";
print STDOUT "iRemote Address: $REMOTE_ADDR \n";
print STDOUT "iServer Port: $SERVER_PORT \n";
print STDOUT "iSelector: $SELECTOR \n";
print STDOUT "iRequest: *$REQUEST* \n";
if ( $SELECTOR =~ /^$REQUEST[?](.*)/ )
        {
        my @argvars = split(" ", $1);
        print STDOUT "iThere were " . scalar @argvars . " arguments \n";
        foreach my $X( @argvars )
                {
                print STDOUT "i $X \n";
                }
        }
print STDOUT "1petergarner.net gopher root\t/\tgopher.petergarner.net\t70\n";
print STDOUT '.';



_______________________________________________
Gopher-Project mailing list
Gopher-Project@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/gopher-project

Reply to: