in reply to Yesterday's date

With DateTime (DateTime::Format::Strptime):

use strict; use warnings; use DateTime::Format::Strptime; my $parser = DateTime::Format::Strptime->new(pattern => '%d/%m/%Y', on +_error => 'croak'); my $dt = $parser->parse_datetime('28/05/2023'); print $dt->subtract(days => 1)->strftime('%d/%m/%Y'), "\n";

Hope this helps!


The way forward always starts with a minimal test.