Try
my $year = 2002; $year =substr($year, -2); print $year; [download]
In reply to Re: sprintf the last 2 digits by BrowserUk in thread sprintf the last 2 digits by fireartist