simonpearce
ISP
Hello! This little piece of code here comes from the OpenSRS system and very nicely outputs the next six years as four digit numbers (2003, 2004, 2005, 2006, 2007, 2008)
BUT can anyone make it so it only outputs two digit numbers (eg 03, 04, 05, 06, 07, 08)????
Hope someone can help!
sub get_cc_years {
my (%years,$i);
my $year = (localtime)[5];
$year += 1900;
for ($i = 0; $i <=5; $i++) {
$years{$year} = $year;
$year++;
}
return \%years;
}
Thanks!
BUT can anyone make it so it only outputs two digit numbers (eg 03, 04, 05, 06, 07, 08)????
Hope someone can help!
sub get_cc_years {
my (%years,$i);
my $year = (localtime)[5];
$year += 1900;
for ($i = 0; $i <=5; $i++) {
$years{$year} = $year;
$year++;
}
return \%years;
}
Thanks!