Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Why can't I open a file for writing?

by Perlbotics (Archbishop)
on Jan 12, 2018 at 21:42 UTC ( [id://1207169]=note: print w/replies, xml ) Need Help??


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

Perhaps the bitwise or (|)?

open NEWFILE, '>', "$dir/subdirectory/$outputfile" | die "Can't open + $dir/subdirectory/$output here-^
Try or or || instead.

Replies are listed 'Best First'.
Re^2: Why can't I open a file for writing?
by tdilling (Initiate) on Jan 12, 2018 at 21:46 UTC

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

      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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found