#!/usr/bin/perl -w use strict; use warnings; use Time::Piece; my $bat_expire = "10/14/2023"; if (Time::Piece->strptime($bat_expire, "%m/%d/%Y") > localtime) { print "Battery replacement is recommended by $bat_expire, according to the UPS estimated life algorithm.\n"; } else { print "The recommended battery replacement date calculated by the UPS algorithm was $bat_expire.\n"; }