You were already given the answer. You get that error because you don't have the Path::Tiny module installed.
Note that you do not need Path::Tiny, or any module, to read in the lines from a file, or to "clear the contents of the file." You can do it without additional modules, including by using Perl's built-int truncate function, as roboticus told you in the first response to your question.
In reply to Re^7: Clear the contents of the text file
by 1nickt
in thread Clear the contents of the text file
by shroh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |