in reply to can't open file for writing that doesn't exist

You're looking at (or showing us) the wrong part of the code. Your code as shown does not contain the string Error: cannot read, so the error message is produced elsewhere.

Where exactly are you getting that error message?

Also, what are the filenames that you construct? Do they contain the absolute filenames, without any whitespace?

Replies are listed 'Best First'.
Re^2: can't open file for writing that doesn't exist
by navalned (Beadle) on Mar 22, 2020 at 19:43 UTC

    Thanks! I need to make some changes to the config_parse().