#!/usr/bin/perl use warnings; use strict; open my $fh, '+>', 'file.log' or die $!; print $fh "Hallo, Welt!\n" or die $!; system('rm -f file.log && touch file.log'); print $fh "Hallo, Welt!\n" or die $!; seek $fh, 0, 0; print <$fh>; close $fh;