in reply to Using Perl saves time....

I thought this should be a one liner. My first thought was-

perl -le "@l = <*>; print scalar @l"

which of course is slooow so I borrowed from your script-

perl -le 'opendir f, $ARGV[0] or die $!;++$c while readdir f; print $c'

I am sure the golfers could slim it down some more :)

--
Murray Barton
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Replies are listed 'Best First'.
Re^2: Using Perl saves time.... [GOLF!]
by radiantmatrix (Parson) on Jul 21, 2005 at 13:48 UTC
    perl -e '++$c for glob "*";print $c'

    Seems to be pretty quick, too.

    <-radiant.matrix->
    Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
    The Code that can be seen is not the true Code
    "In any sufficiently large group of people, most are idiots" - Kaa's Law