#!/usr/bin/perl use warnings; use strict; use Carp; open(my $count_file,"+<","count.txt") or croak "cant open"; my $count=<$count_file>; $count++; print $count_file $count; print $count; __END__