in reply to Re^2: $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 ?

Sounds like you are trying to fix something little by introducing uncertainty to the inheritance structure, which could be viewed as a bigger issue.

I don't see any issue with the current way seek() works. As long as the return code is correct, it shall not impact your ability to develop on top of it.

  • Comment on Re^3: $io->can('seek') == true, but $io->seek(pos, whence) == 'Illegal seek' - bug ?

Replies are listed 'Best First'.
Re^4: $io->can('seek') == true, but $io->seek(pos, whence) == 'Illegal seek' - bug ?
by hakkr (Chaplain) on Nov 15, 2004 at 14:46 UTC

    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 be

    Now 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"; }