Unmatched ( in regex; marked by <-- HERE in m/mozilla/5.0 ( <-- HERE macintosh; u; safari/525/ at script.pl line 30.
####
# Does $user contain the string from $useragent
$user =~ /\Q$useragent\E/
####
# Is $user equal to the string from $useragent
$user =~ /^\Q$useragent\E\z/
####
# Is $user equal to the string from $useragent
$user eq $useragent