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 ?

Thanx, that is a very lucid answer - I wasnt really happy with pg's answer a first, now I have no problems.

Update:Actually I had the drive to work to think about this and I'm less happy.

I understand this is not going to change, but the DWIM part of this still irks me.

I accept that if $io_obj->can('seek') is true I still need to check the return code of $io_obj->seek(pos,whence) because 'things can happen' (tm) like drives failing etc.

But I can't see how a stream can ever become seekable, so the true value from can() doesnt help the argument of perl DWIM.

So my final points are

use brain;