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

[MacPerl] my first script, what's wrong?



Well, I have gotten my almost first useful script, but It is not working
correctly.  Whenever I run it, I get the else statement saying "not
testable".  I know I have macHTTP running correctly, as well as the macHttp
cgi runnable as well.

I would love any ideas.

#!/usr/local/bin/perl

@user_agent = split (/\//,$ENV{'HTTP_USER_AGENT'});

if ($user_agent[0] eq "Mozilla") {  #I have tried mozilla, netscape and Netscape
        @version = split (/  /,$user_agent[1]);  #get the first index of
from the user_agent
        $version_number = substr ($version[0], 0, 3); #break the
version_number into the first 3 number
        if ($version_number < 1.1) {
                print "you are using mozilla greater than 1\n\n";
        }
        else {
                print "you are using mozzila less than 1\n\n";
        }
}
else {
        print "not testable"
}

TIA

__________________________________________________
Dolphinative Images                               )
--------------------------------------------------(
Adam Berns                  ) phone  916.242.1594 )
adam@dolphinative.com       ( fax    916.242.1597 (
http://www.dolphinative.com )                     )
---------------------------------------------------