For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > December 2005 > checking useragent using perl ? how to









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author checking useragent using perl ? how to
dogmore

2005-12-10, 12:25 am

well this is a code it checks the useregent database if useragent found it will will gather info abt ips of search engine bots....the real problem is i have give full useragent string on database like : googlebot/2.1 (+http://www.googlebot.com/bot.html) .....i want something if i give "Google" in datbase it can auto check the full useragent string and if any words found it gathers info abt bot ips.

code:
$search_engine = (); foreach $agentbase (@register) { next if ($agentbase =~ /^[#-]/); next if ($agentbase =~ /^\s*$/); chomp $agentbase; if ( $user_agent eq $botbase ){ $search_engine = 1; last; } } return; }
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com