Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
"be consistent"
 
PerlMonks  

Re: Open file for output errors

by kennethk (Monsignor)
on Nov 21, 2013 at 21:09 UTC ( #1063808=note: print w/ replies, xml ) Need Help??


in reply to Open file for output errors

The open wouldn't fail because of intended output. My guess is there is a problem with your file specification. Are you sure you're getting a legal file name? Since Perl is agnostic to forward/backward slashes in paths on Windows, what happens when you change your open statement to:

open $OFH, ">", "$directory_name/$output_file_name" or die "Could not open output file: $directory_name/$o +utput_file_name\n$!";
I suppose it might also be related to your odd filehandle scoping, but Perl should be handling that cleanly.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re: Open file for output errors
Download Code
Re^2: Open file for output errors
by Kenosis (Priest) on Nov 21, 2013 at 21:31 UTC

    Since Perl is agnostic to forward/backward slashes in paths on Windows...

    I'll be quietly retreating to the Monastery's iconostasis--visiting the Wall--to meditate upon the phrase Perl is agnostic...

Re^2: Open file for output errors
by steidley (Initiate) on Nov 21, 2013 at 22:09 UTC
    By typing in your suggestion, it allow the script to run... That is kind of a head scratcher! Now all I need to do is figure out how to get the script to stop the auto converting of the '0x0A'. For that I am not ready to throw in the towel just yet. But at least now I have some way of testing it out. Thank you for pointing me in the right direction.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-04-25 09:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (586 votes), past polls