in reply to regex not working right

You've confused the m//atching operator for a regular expression, a regular expression goes inside the m//atching operator
## matching operator $var =~ m{}; $var =~ m//; $var =~ //; ## matching against default variable, against $_ m{}; m//; //;

So when your program gets the string  "^atlas\S+/ || /\/world\s+/ || /\nowhere\s+" its not a very good regular expression, it has all these extra | and /