19 lines
440 B
Perl
19 lines
440 B
Perl
|
#!/usr/bin/perl -T
|
||
|
|
||
|
use strict;
|
||
|
use CGI qw/:standard/;
|
||
|
|
||
|
my $useragent = $ENV{'HTTP_USER_AGENT'};
|
||
|
|
||
|
print header,
|
||
|
start_html('User Agent Example');
|
||
|
if ($useragent =~ /Firefox/) {
|
||
|
print p("You are visiting with a Firefox browser");
|
||
|
} elsif ($useragent =~ /MSIE/) {
|
||
|
print p("You are visiting with an Internet Explorer browser");
|
||
|
} else {
|
||
|
print p("Could not determine browser: $useragent");
|
||
|
}
|
||
|
print end_html;
|
||
|
|
||
|
exit;
|