in reply to Re: Why can't I open a file for writing?
in thread Why can't I open a file for writing?

Arrrgh! That fixed it. That's what happens when you stare at the same line of code for too long... LOL

  • Comment on Re^2: Why can't I open a file for writing?

Replies are listed 'Best First'.
Re^3: Why can't I open a file for writing?
by jwkrahn (Abbot) on Jan 13, 2018 at 02:36 UTC

    If you use || instead of or then you need parentheses for the open function:

    open( NEWFILE, '>', "$dir/subdirectory/$outputfile" ) || die "Can't +open $dir/subdirectory/$output