in reply to Useless Program

Also, since $name isn't going to change during the course of the program, use the 'o' modifier to tell perl to compile the regex once instead of every time it is evaluated. This will speed up your search. /^$name$/io