in reply to Golfing a size/date grabber

This shortens it a little and cleans up the output some too.

perl -lne '@f=localtime((stat)[9]);$t{sprintf"%d%02d%02d",$f[5]+1900,$ +f[4]+1,$f[3]}+=-s;}{print"$_ $t{$_}"for keys%t'

But... to what purpose do you want to golf this? If you are tired of typing it or something, just stick it in a shell script as is and forget about it.

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Re: Golfing a size/date grabber
by holo (Monk) on Nov 19, 2003 at 20:53 UTC

    And that's only a bit shorter (and a bit faster) but still pointless to golf this

    perl -lne '@f=localtime((stat)[9]);$t{sprintf'%02d'x3,$f[5]+1900,$f[4]+1,$f[3]}+=-s _;}{print"$_ $t{$_}"for keys%t'

    BTW: sauoq got ++

Re: Re: Golfing a size/date grabber
by delirium (Chaplain) on Nov 19, 2003 at 20:23 UTC
    to what purpose do you want to golf this?

    Asthetics, mainly. I was never happy with having the two stat commands in there, and the END{} block was ugly, and I didn't really want to import Data::Dumper.

    Fortunately, all these problems have been solved. Thanks.