in reply to Weird 5.8.8 Solaris <> bug
That somewhat reminds me of the buffering problem with $./file offset and implicit close we've seen for stdout recently, even if this time, there's no magic hardcoded "stdout" involved. Still I no longer quite trust buffering for implicit close and reopen:
As tye suggests, try an explicit close of ARGV in the sub (before return) and in addition explicitly close $fh after printing (instead of implicitly by leaving the scope).
Note that you currently assign multiple times the same filename to @ARGV for an implicit <> open, which might be an interesting part of the confusion between Perl's IO and underlying OS IO you observed.
|
|---|