Keep It Simple, Stupid | |
PerlMonks |
Re: Creating a new file in a directoryby Monk::Thomas (Friar) |
on Aug 21, 2015 at 08:57 UTC ( [id://1139395]=note: print w/replies, xml ) | Need Help?? |
Suggestion: instead of creating the filename twice, like in
it is better do it once and use a variable
The reason is to avoid any chance of updating the filename used for open() but forgetting about the error message. one more improvement - include the reason why the open failed
P.S.: You are using UNIX-Style forward slashes on a Windows-Platform: D:\.../file_detail.txt You probably want to fix that.
In Section
Seekers of Perl Wisdom
|
|