in reply to Re^3: $io->can('seek') == true, but $io->seek(pos, whence) == 'Illegal seek' - bug ?
in thread $io->can('seek') == true, but $io->seek(pos, whence) == 'Illegal seek' - bug ?
I agree there is nothing wrong with inheriting methods that are not implemented. You could say that seek is an abstract method of the base class which in this case has not been implemented.
It is still correct to have it in there as the base class is defining as part of an interface and saying it always must beNow if it really bothers you then you can put in your own overridden implementation of seek() that just throws a better error like 'not relevant to this instance type'.
sub seek () { die "inherited method not callable or implemented on this type of obje +ct"; }
|
|---|