Wednesday, 26 June 2013

Yesterday Perl script

A quick script to display yesterday's date in a specified date format:

#!/bin/perl -w

use strict;
use POSIX qw(strftime);
use Time::Local;

{
   my $yesterday=time() - (24 * 60 * 60);
   print strftime("%d%m%Y", localtime($yesterday));
}