fireartist has asked for the wisdom of the Perl Monks concerning the following question:
which returns 02, but I'd rather not use a regex (for speed reasons).my $year = 2002; $year =~ s/.*(\d\d)$/$1/; print $year;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sprintf the last 2 digits
by BrowserUk (Patriarch) on Oct 03, 2002 at 13:54 UTC | |
by fireartist (Chaplain) on Oct 03, 2002 at 15:08 UTC | |
|
Re: sprintf the last 2 digits
by Zaxo (Archbishop) on Oct 03, 2002 at 14:08 UTC | |
|
Re: sprintf the last 2 digits
by diotalevi (Canon) on Oct 03, 2002 at 14:04 UTC | |
|
Re: sprintf the last 2 digits
by belg4mit (Prior) on Oct 03, 2002 at 18:06 UTC | |
|
Re: sprintf the last 2 digits
by hopes (Friar) on Oct 03, 2002 at 16:07 UTC |