Yes, it not new already, but thus I met it - with my Perl timer:
use strict; use Time::Local; $|++; my $nyear = (split '\s', localtime)[5]+1; my @ndate = (0, 0, 0, 0+1, 0, $nyear); my $ndate = timelocal(@ndate); while((my $time = $ndate - time) > 0 and sleep 1){ print "$time seconds left untill $nyear ... $/"; } print "$/ Happy New $nyear! $/"


Replies are listed 'Best First'.
Re: The way I met this (already not) new 2005 year
by polettix (Vicar) on Mar 19, 2005 at 08:53 UTC
    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.
      or (maybe):
      ... (my$nyear = localtime) =~ s/.+?(\w+)$/$1+1/eo;#:) ...