my $sth = $dbh->prepare( "SELECT alpha FROM main WHERE alpha LIKE '%$search_ip %'" ); $sth->execute(); my ($complete_match) = $sth->fetchrow_array;