I wanted to check to see if the method I was writing was overriding an existing method in a parent class. That's when I realized that I don't know a truly clean way of doing that. I tried this, but it fails (as it should):
#!/usr/bin/perl -l use strict; use warnings; { package A; sub foo { 'Whee!' } sub check { return shift->SUPER::can('foo') } } print A->check->();
The only thing I can cleanly think of is walking through @ISA, but this seems like such an obvious thing that someone would have solved this.
Cheers,
Ovid
New address of my CGI Course.
In reply to Detecting Overridden Methods by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |