in reply to Script is unable to open file
EDIT: This answer is incorrect for the OP's specific problem as I wasn't doing a full test on the code, and was only using the result. marinersk pointed out the real issue.
What this points out is the error reporting difference when using strict and not when using a file path in Windows without escaping the path delimiters (\).
With use strict;
C:\Users\steve\Desktop>perl log.pl Unrecognized escape \s passed through at log.pl line 4. Unrecognized escape \O passed through at log.pl line 4. Unrecognized escape \m passed through at log.pl line 4. Invalid argument at log.pl line 4.
Without use strict;
C:\Users\steve\Desktop>perl log.pl Invalid argument at log.pl line 2.
See the difference and how it expressly shows you the exact specific problems? To fix this, double up your backslashes in the path:
"e:\\scripts\\OutageNodes\\maintenanceMode_201586 9:45:1.log"
-stevieb
|
|---|