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 name 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. how to do it ?

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