Based on your OP code; I cannot see a problem that would cause that error; but you have modified your code and that error message is a typical catchall report that is manifest when perl is confused by a typo.
The fastest solution would be to post the modified code that is producing the error.
In reply to Re^3: Failed to open file for write
by BrowserUk
in thread Failed to open file for write
by wrkrbeee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |