if ($urlcheck =~ m/[^\s]/){ #stuff to do bad url here }