You are right. I hadn't read the documentation carefully enough and hadn't spotted that. Running hexdump -C shows that a seek is indeed necessary.
$ perl -Mstrict -Mwarnings -e '
> open my $fh, q{>}, q{rubbish} or die $!;
> print $fh qq{A longish line of text\n};
> truncate $fh, 0 or die $!;
> print $fh qq{Short\n};
> close $fh or die $!;'
$ cat rubbish
Short
$ hexdump -C rubbish
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |.........
+.......|
00000010 00 00 00 00 00 00 00 53 68 6f 72 74 0a |.......Sh
+ort.|
0000001d
$
Thank you for the correction.
|