open(COUNT,"<$data_dir/counter.txt");
open(COUNT,"+<$data_dir/counter.txt") or die "$data_dir/counter.txt: $!";
Und am besten noch:
flock COUNT, 2;
$counter=<COUNT>;
seek(COUNT,0,0);
$counter++ ;
print COUNT $counter ;
close (COUNT) ;
Viele Grüße,
Daniel Bradler