Perl Monk, Perl Meditation | |
PerlMonks |
Re^7: Clear the contents of the text fileby 1nickt (Canon) |
on Jul 22, 2015 at 03:18 UTC ( [id://1135781]=note: print w/replies, xml ) | Need Help?? |
You can't have a "self-contained test" if you are testing writing to a file. You need to write to the file. The shell commands showed the output of cat. The test showed exactly what the output indicated: If you pass append() an empty string, as shown in the spew() example I was replying to, you will get an error. And the reason to do this in the OP's case is not for file permission preservation, but for file locking.
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom
|
|