我是Perl的初学者,我需要使用Perl模块Date :: Easter中的函数来创建一个程序,从用户输入开始需要一年的时间并在那一年显示复活节的日期,我需要知道如何将该模块合并到脚本中以获得所需的结果。
答案 0 :(得分:2)
足够简单:
#!/usr/bin/perl
use strict;
use warnings;
use Date::Easter;
chomp (my $year = <STDIN>);
my ($m1, $d1) = easter ($year);
my ($m2, $d2) = julian_easter ($year);
my ($m3, $d3) = orthodox_easter ($year);
print "Gregorian => Month: $m1 Day: $d1\n";
print "Julian => Month: $m2 Day: $d2\n";
print "Orthodox => Month: $m3 Day: $d3\n";