Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Weird 5.8.8 Solaris <> bug

by jakobi (Pilgrim)
on Oct 29, 2009 at 07:10 UTC ( [id://803895]=note: print w/replies, xml ) Need Help??


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.

cu & HTH, Peter -- hints may be untested unless stated otherwise; use with caution & understanding.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://803895]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-24 02:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found