[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Time question



At 21.54 +0000 2000.01.06, John Delacour wrote:
>        #!perl -w
>        use strict;
>        my ( @time, $timestamp, $save) = (localtime time);
>        my ($year, $mon, $mday, $hour, $min, $sec) =
>             @time[5,4,3,2,1,0];

Just an FYI, since you are not using @time again, you can do:

  my($year, $mon, $mday, $hour, $min, $sec, $timestamp, $save) =
    reverse((localtime)[0 .. 5]);

Although it is probably better to do:

  my($sec, $min, $hour, $mday, $mon, $year, $timestamp, $save) =
    (localtime)[0 .. 5];

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org