[Chicago-talk] Dynamic method call
lembark at jeeves.wrkhors.com
Sat Nov 8 14:30:12 CST 2003
-- Paul Baker <pbaker at where2getit.com>
> On Nov 7, 2003, at 2:24 PM, Steven Lembark wrote:
>> For one rather nice way: perldoc Class::Contract;
> That's for OO where prototypes don't matter anyway.
Actually, you can screw people trying to use OO with
prototypes quite nicely
> Which brings me to the point. When I'm doing complex things, I generally
> go with OO so prototypes are a non issue and I'm doing manual more
> complex checks anyway.
> But when doing functions that are taking general not-too-complex
> arguments, where you may only ever screw up by not giving the right
> number of them, that's when I use prototypes.
@_ == 6 or croak "Bogus call: offball count, should be 6";
doesn't seem like all that much typing. If folks pass in too
few values you'll give back an uninit value warning at which
point it gets pretty obvious what happend.
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 888 359 3508
More information about the Chicago-talk