Random Post: Welcome to phpResource
RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • About Me
  • My Publications
  • My Work Domain
  • phpResource Feeds
  •  

    Browser Detection by PERL

    I am enjoying PERL a lot. I am seeing everything new in PERL. I want to share interesting and important PERL stuffs through my blog.

    Here is a PERL subroutine that detects whether the browser is Firefox or NOT.

    sub is_firefox {
    my $agent = ”;
    $agent = $ENV{“HTTP_USER_AGENT”} || ”;
    if (length($agent) && $agent =~ m/firefox/si) {
    return 1;
    }
    return 0;
    }

    Enjoy PERL, the scripting pioneer.

    $Rupom

    Leave a Reply

    You must be logged in to post a comment.