in reply to Simple length question
I'm not sure which reasons lead you to that design. The more common approach is something like:
or even&err( "Too Few Characters in Company Login Name" ) if length($compname) < 6;
where you code:$errmsg = "Too Few Characters in Company Login Name"; &err($errmsg) if (length($compname) < 6);
rather than using a shared (probably global) variable. This might even fix the problem you are having as managing to get the variable properly shared can sometimes be tricky (I can't say since you didn't tell us what error you were getting).sub err { my( $errmsg )= @_; # ... }
However, if you insist on not passing the error message to the "err" subroutine, you should at least do:
as &err w/o the parens is a special case that should usually be avoided. See (tye)Re: A question of style for more on that. - tye (but my friends call me "Tye")$errmsg = "Too Few Characters in Company Login Name"; &err() if (length($compname) < 6);
|
|---|