#!usr/bin/perl -w use strict; my $one_day_secs = 24*60*60; my $today = time(); my $today_string = localtime($today); my $yesterday_string = localtime($today-$one_day_secs); print "today as epoch time: $today\n"; print "today: $today_string\n"; print "yesterday: $yesterday_string\n"; print time __END__ output: today as epoch time: 1252088732 today: Fri Sep 4 11:25:32 2009 yesterday: Thu Sep 3 11:25:32 2009 #### #!/usr/bin/perl -w use strict; my $a = "1"; $a =~ s/^(\d)$/0$1/; print $a;