in reply to The way I met this (already not) new 2005 year

I was wondering if there is any reason (apart from personal taste or lazyness, which I value most :) for using:
my $nyear = (split '\s', localtime)[4]+1;
instead of
my $nyear = (localtime)[5] + 1;
for getting the year. Notwithstanding, it had a positive effect: it made me learn that localtime can be meaningfully invoked in scalar context too.

Flavio

-- Don't fool yourself.

Replies are listed 'Best First'.
Re^2: The way I met this (already not) new 2005 year
by sh1tn (Priest) on Mar 20, 2005 at 18:40 UTC
    or (maybe):
    ... (my$nyear = localtime) =~ s/.+?(\w+)$/$1+1/eo;#:) ...