c:\@Work\Perl\monks>perl -wMstrict -le "use constant NOT_ALLOWED => qr{ [^-\x27\x23\$\@0-9a-zA-Z.\\/_%(){}&!~`^] }xms; ;; for my $str ('', qw(ABC_ABC 'A' ///?/// =*+| ABC=), ' ', qq{\t\r\n}) { my $status = 0 + $str =~ NOT_ALLOWED; print qq{[$str] $status}; } " [] 0 [ABC_ABC] 0 ['A'] 0 [///?///] 1 [=*+|] 1 [ABC=] 1 [ ] 1 [ ] 1