in reply to Not matching REGEX

This
if ($str =~ /nbk[A-z0-9]{4}/ or /nbd[A-z0-9]{4}/ or /root/){

is the same as

if ($str =~ /nbk[A-z0-9]{4}/ or $_ =~ /nbd[A-z0-9]{4}/ or $_ =~ / +root/){

which not what I think you're after. Perhaps you meant

if ($str =~ /nbk[A-z0-9]{4}/ or $str =~ /nbd[A-z0-9]{4}/ or $str +=~ /root/){

Replies are listed 'Best First'.
Re^2: Not matching REGEX
by cutter (Acolyte) on Aug 30, 2007 at 18:21 UTC
    That was it. In the legacy code the $_ held the owner value, so it worked there. Thanks a bunch.