Because no $ end-of-string anchor is used, the /^[A-Za-z]{3}\d{3}/ match may allow something improper:
See above for a variation that avoids this problem. See also perlre, perlrequick, and perlretut.c:\@Work\Perl\monks>perl -wMstrict -le "my $os_user = 'foo9876543210'; $os_user =~ /^[A-Za-z]{3}\d{3}/ or die qq{bad user name: '$os_user'}; print qq{'$os_user' is ok by me!}; " 'foo9876543210' is ok by me!
Give a man a fish: <%-(-(-(-<
In reply to Re^2: Checking name convention
by AnomalousMonk
in thread Checking name convention
by zalezny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |