[root@june2 ~]# cat 2.pl
use POSIX qw(strftime);
my $yesterday = strftime "%Y-%m-%d", localtime(time-86400);
my $today = strftime "%Y-%m-%d", localtime;
my $tomorrow = strftime "%Y-%m-%d", localtime(time+86400);
print "$yesterday is $yesterday
";
print "$today is $today
";
print "$tomorrow is $tomorrow
";
[root@june2 ~]# perl 2.pl
$yesterday is 2014-04-13
$today is 2014-04-14
$tomorrow is 2014-04-15