In conclusion and after much consulting, taking the following code:
#$url = substr($test, 0, $_);
#if ($test =~ /$url/ {
We can easily simplify that to:
if(1){
You're welcome.
(Note: of course now the original poster will post some wacky and zany update involving metachars, and i shall look extremely silly and lose much XP. Damn.)