Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I've played and played with this on 2k.
There are 2 ways that I can recreate this error, but neither of them seem applicable.

First, if I don't have the die statement after the open, and use a bad filename I get the error after the close. This is obvious.

Second, if the file has only read permissions, and I print to it (with a die statement on the print) I get the same error, which is only slightly less obvious.

In your code though, you are not modifying the file in anyway, and have the die statement after the open.

If you attempt to simply open and close the filehandle (for the file that you are having the problem with) in a seperate script does the same thing happen? Is this happening with every file, or is it just one (I ask that because I see this in a subroutine, I'm assuming multiple files)?

Is this code cut and pasted from your script or did you retype it here? I've retyped the code a couple of times, rather than pasting it in and noticed that my code I'm submitting here and the code I'm having the problem with has occasionaly differed subtly (with the difference being what was causing the problem).

In reply to Re: Win32 bad file descriptor by the_slycer
in thread Win32 bad file descriptor by Dalin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2023-01-29 18:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?