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

Thanks chromatic--invaluable example. I tried it and worked like a charm. And I get what you've done, with the exception of the $class variable. Why is it there, where does it get it's value, and what does it return? Also, it seems like the $email in the error string really will never have a value...right?


—Brad
"A little yeast leavens the whole dough."

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

    Good catch on the $email variable in the example. It's pretty useless in the error message. :)

    As for $class, the Validate->email() call is actually a class method call. You can read it as "call the email method of the Validate class".

    Due to the way Perl's OO works, the invocant (the noun: a class or object) you're asking to perform the verb (the method) is passed as the first argument to the method. In an object method call, you'd get the object as the first p arameter. In a class method call, you get the class name.

    perloot and perlboot have more details.