in reply to Detect Mac Browser

You could also use the $ENV{} hash to access the brower string. The user agent/browser info is stored in $ENV{HTTP_USER_AGENT}. Your code would change to :

my $browser = $ENV{HTTP_USER_AGENT};

I use this little program to see what is available on the different browsers that I test.

#!/usr/bin/perl ## ## printenv -- print the environment ## print "Content-type: text/plain\n\n"; foreach $var (sort(keys(%ENV))) { $val = $ENV{$var}; $val =~ s|\n|\\n|g; $val =~ s|"|\\"|g; print "${var}=\"${val}\"\n"; }

Replies are listed 'Best First'.
Re^2: Detect Mac Browser
by Aristotle (Chancellor) on Oct 02, 2003 at 20:02 UTC
    That's exactly the value he gets by calling CGI.pm's user_agent function.

    Makeshifts last the longest.