NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
More Defense (Score:1)
I could patch SUPER to call
$invocant->can( '__get_parents' )before calling it in the eval, but this seems like a corner case. I'll think about it.Re: (Score:1)
I thought about that a little bit myself. It's definitely a corner case, but it can (demonstratedly) be a pretty serious benefit. Then again, "can" is a lying jerk and it means more overhead for all the code that would've worked just fine otherwise...
I think the best solution might just be for people to STOP USING AUTOLOAD... at least when it's not really the right (read: only) way to do something. This was clearly a gratuitous use of AUTOLOAD.
If you patch SUPER, though, I won't mind one bit!
rjbs
Re: (Score:1)
People who don't override
canwhen necessary are like people who don't check the return calls of system calls. Sure, you hope things will go right, but if you want to play nicely with the rest of the system, you ought to be a good neighbor.Re: (Score:1)
That’s true. However, it doesn’t alter the conclusion: if you can avoid
AUTOLOAD, you should. It is much likeevalandgoto LABELin that regard.Re: (Score:1)
People who override can when they think it necessary almost always get it wrong. But we've had this discussion before.
Re: (Score:1)
Yes, we have, and you're still wrong to suggest that people break the way Perl objects work because you don't think they're smart enough to do it right.
I think we can all agree that
AUTOLOADis overused, and often poorly.Re: (Score:1)
Considering how many competent programmers I have seen try and fail, I think the ball is in your court to demonstrate that it is both possible and likely enough to happen that it is worth insisting on.
Re: (Score:1)