while(($name,$pass,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwent()) { if(!($shell =~ m/false/ || m/null/ || m//)) { print blah... } }