Keep It Simple, Stupid | |
PerlMonks |
Re: Elfproef (Dutch bank account check)by CheeseLord (Deacon) |
on Jul 28, 2001 at 22:40 UTC ( [id://100578]=note: print w/replies, xml ) | Need Help?? |
This might just be a matter of taste, but I wouldn't die if the string wasn't 9 digits long; instead, I'd return false, as it clearly is an invalid number. I'm a bit wary of having subroutines cause my program to die. Then again, I don't know the context of the sub in your program. :-) Also, if you're going to check the input for validity, you might also test that the string contains all digits; /^\d{9}$/ would take care of both conditions. Just some things to think about. His Royal Cheeziness
In Section
Cool Uses for Perl
|
|