#!/usr/bin/perl use warnings; use strict; sub add_one_day { my $timestamp_file = 'timestamp.txt'; open my $read_fh, '<', $timestamp_file; chomp ( my $timestamp = <$read_fh> ); close $read_fh; $timestamp += 86400; open my $write_fh, '>', $timestamp_file; print $write_fh "$timestamp\n"; close $write_fh; }