in reply to Re^2: Changing the Value Assigned To A Hash Key
in thread Changing the Value Assigned To A Hash Key
If you really want at least two characters and the first one must be in [A-Z], use this instead: [A-Z][A-Za-z\-']+. It does the trick :-)
As for returning the warning string, I don't think that's a good idea, because both 1 and "Friendly message..." evaluate to a true value; hence, the caller won't be able to tell the difference easily. Return 0 or undef in case there's something wrong. This way, you can do something like if ($first_name_check) {.
The Cookbook sure is a good book, but I'd advise you to buy the Learning Perl. Trust me, it'll be worth the money and you'll enjoy the reading :-)
|
|---|