in reply to Re: Checking name convention
in thread Checking name convention
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: <%-(-(-(-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Checking name convention
by Stringer (Acolyte) on Feb 24, 2015 at 20:22 UTC |