in reply to truncate or trunc

What errors do you have?

This works for me:

open my $fh, "+<", $filename or die $!; truncate $fh,$pos or die $!;

or directly

truncate $filename,$pos or die $!;

Hope this helps

citromatik