use File::Slurp; my $file = read_file( "file.rtf" ); $match = "Date of Last Update: "; if ($file =~ /$match/){ open my $file, "<", "file.rtf"; my $startpos = "@-"+2; #if date is 8 chars then change to "@-"+1 seek $file, $startpos, 0; read $file, my $calender_date, 31; #if date is 8 chars change to 30 print $calender_date; }