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.

Replies are listed 'Best First'.
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.