- or download this
$ perl -MPOSIX=strftime -le'print strftime "%a %b %e %Y", localtime'
Thu Dec 17 2009
- or download this
$ perl -le'substr(my $now = localtime, 11, 9, ""); print $now'
Thu Dec 17 2009
- or download this
Rate splice strftime slice subst substr
splice 93974/s -- -23% -40% -49% -64%
...
slice 157894/s 68% 30% -- -14% -40%
subst 182658/s 94% 50% 16% -- -30%
substr 261283/s 178% 115% 65% 43% --
- or download this
use strict;
use warnings;
...
for values %tests;
cmpthese(-3, \%tests);