I know there is a much simpler way to do this. What this does is check a URL 
written with and without www.  or trailing / against a list of urls that (one 
at a time) are placed in $siteurl2. 

$FORM{'siteurl'} is the site url being submitted.
$alternativeurl is $FORM{'siteurl'} without the www. if with.
$xalternatives is $FORM{'siteurl'} with the www. if without.

This works ok it seems, but it's horrible code. There must be a better way to 
write this. Any help will be appreciated.

          if (($FORM{'siteurl'} =~ /$siteurl2$/) || ($FORM{'siteurl'} =~ 
/$siteurl2\/$/) || ($alternativeurl =~ /$siteurl2$/) || ($alternativeurl =~ 
/$siteurl2\/$/) || ($xalternatives =~ /$siteurl2$/) || ($xalternatives =~ 
/$siteurl2\/$/)) {
              print "Found 1 \n";
          }

Reply via email to