No, it isn't random. Yes, you shouldn't depend on it.
In this case, I'm willing to bet that Perl has code
that tries to seek, perhaps to more portably
flush buffers. It is perfectly acceptable to try to seek
and then see whehter or not it worked in order to tell if
you happen to have a file handle to a stream that supports
seeking.
$! actually starts out as zero in a new
process (no, I don't think this is guarenteed anywhere) but quickly gets changed when something deep in the guts of some library does something that fails.
And indeterminate means it could be undef or "Illegal seek" or anything else.
|