in reply to Shrink this sort subroutine

Well, first off, your use of timelocal is broken. And I wouldn't bother doing that anyway... you already have sortable strings!
my @node_list = sort { $nodes{$a}{createtime} cmp $nodes{$b}{createtim +e} } keys %nodes;

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Shrink this sort subroutine
by donfreenut (Sexton) on Apr 24, 2001 at 22:37 UTC

    Well, that certainly is shorter...

    My mistake when I tried that earlier was using '<=>' instead of 'cmp.' Probably should have been suspicious of a string comparison with a non-alphanumeric operator...

    Argh.

    Thanks, all...

    ---
    donfreenut