in reply to Using split, splice, and join to remove time from scalar context return of localtime()
my $now = localtime; my @t = split /\s/, $now; splice @t, 3, 1; $now = join ' ', @t;
That won't work very well during the first nine days of the month:
$ perl -le' my $now = localtime 1260043200; print $now; my @t = split /\s/, $now; splice @t, 3, 1; $now = join " ", @t; print $now; ' Sat Dec 5 12:00:00 2009 Sat Dec 12:00:00 2009
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using split, splice, and join to remove time from scalar context return of localtime()
by jffry (Hermit) on Dec 17, 2009 at 23:49 UTC | |
by ikegami (Patriarch) on Dec 18, 2009 at 00:59 UTC |