if ((grep {$_ eq $links[0] } @visited_urls) > 0) { print "URL found\n"; } else { print "URL not found\n"; }