-
Write a perl Script to take any date value as input and find out and print how many days, months and year are remaining for that date.
-
Here Is my code:
!/usr/bin/perl
use strict;
use warnings;
use feature 'say';
use Time::Piece;
print "date:\n";
chomp(my $date = <STDIN>);
print "mon:\n";
chomp(my $mon = <STDIN>);
print "year:\n";
chomp(my $year = <STDIN>);
my $tp = Time::Piece->strptime("$year-$mon-$date", '%Y-%m-%d');
say $tp->fullday;
-
My code's Output:
-
University Name: University Of Development Alternative