Detect Firefox browser with perl script/function |
| Home » Perl » Detect Firefox browser with perl script/function |
| Date: 2006-01-27 |
|
Link: http://perl.devquickref.com/perl-firefox-browser-detection-perl-script.html
|
Detect Firefox browser with perl script/function |
|
|
| |
#!/usr/bin/perl # Example: # print "Content-type: text/html\n\n"; # print is_firefox(); # /** # * checks for user agent whether this is firefox or not # * @param void # * @return bool # * @author svetoslavm##gmail.com # * @link http://devquickref.com/ # */ sub is_firefox { my $agent = ''; $agent = $ENV{"HTTP_USER_AGENT"} || ''; if (length($agent) && $agent =~ m/firefox/si) { return 1; } return 0; }
|
|
|