in reply to Re: Am I passing and testing user data correctly?
in thread Am I passing and testing user data correctly?

Thanks Zaxo for the kind words:
I like to put a definite true, like 1; at the end of a sub which modifies its arguments.
Do you mean this for all subs? Or just the .pm?

—Brad
"A little yeast leavens the whole dough."
  • Comment on Re: Re: Am I passing and testing user data correctly?

Replies are listed 'Best First'.
Re: x 3: Am I passing and testing user data correctly?
by Zaxo (Archbishop) on Nov 21, 2003 at 04:18 UTC

    It's a useful convention in perl that operator-like subs (and many others) should return true if they are successful. The only one of your validation functions which might not is sub val_alpha, which successfully detaints an empty string and returns it. I make it a habit to avoid that automatically so I don't have to think about it :)

    It is only a convention, but a profoundly useful one. Perl does nothing to demand you follow it.

    After Compline,
    Zaxo