in reply to Simple length question

I'm not sure which reasons lead you to that design. The more common approach is something like:

&err( "Too Few Characters in Company Login Name" ) if length($compname) < 6;
or even
$errmsg = "Too Few Characters in Company Login Name"; &err($errmsg) if (length($compname) < 6);
where you code:
sub err { my( $errmsg )= @_; # ... }
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).

However, if you insist on not passing the error message to the "err" subroutine, you should at least do:

$errmsg = "Too Few Characters in Company Login Name"; &err() if (length($compname) < 6);
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")