Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Open file for output errors

by kennethk (Abbot)
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.

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063808]
[karlgoethebier]: no typo
[marioroy]: At the Fransiscan monastery, got stuck up high in a tree from pruning and the chainsaw with large branch fell and broke the latter, but not me fortunately. Was stuck there for a while until a firetruck came by.
[Corion]: marioroy: So you live dangerously ...
[Lady_Aleena]: s/latter/ladder/; # ? marioroy
[karlgoethebier]: marioroy: Praise the Lord
[marioroy]: Well, that's why there must be angels around, invisible or not.
[marioroy]: Lady_Aleena yes, ladder.
[marioroy]: Corion, no not intentionally. not at all.
[Lady_Aleena]: /ne tries to decide whther or not to take a hammer to hubby's alarm clock.
[Lady_Aleena]: He never hears it.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-05-29 08:36 GMT
Find Nodes?
    Voting Booth?