[18:45][nick:~/monks]$ cat test.dat foo bar baz quux [18:45][nick:~/monks]$ cat 1135741.pl #! perl -w use strict; use feature qw/ say /; use Path::Tiny qw/ path /; my $file = 'test.dat'; my @lines = path( $file )->lines( { chomp => 1 } ); #my @append = (); # empty array path( $file )->append( '', { truncate => 1 } ); say "Done."; __END__ [18:45][nick:~/monks]$ perl !$ perl 1135741.pl Done. [18:45][nick:~/monks]$ cat test.dat foo bar baz quux HASH(0x7fa310898690)