use Path::Tiny qw/ path /; path( 'foo.txt' )->spew(""); [download]
In reply to Re: Clear the contents of the text file by Anonymous Monk in thread Clear the contents of the text file by shroh