# If you have a link that includes a space, # then remove the space from the last set of brackets ($linkloc) = ($html =~ m/.*href=["']([^"'> ]+)/s); #### ($linkloc) = ($html =~ m/.*href=["']([^"'> ]+)[^>]*>\s*