Using > instead of < will open it for writing and truncate the file.
open (FILE, '>', 'sample.txt') or die "Could not open sample.txt: $!"; close (FILE) or die "Could not close sample.txt: $!";
In reply to Re^4: Deleting on Files
by eric256
in thread Deleting on Files
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |