in reply to Runing Command

TMTOWTDI:

#!/usr/bin/perl -w opendir( DIR, $ARGV[0] ) || die "canot open $ARGV[0] ($!)\n"; map { $cnt++ unless /^\./ } readdir( DIR ); closedir( DIR ); print $cnt, "\n";

-derby

Replies are listed 'Best First'.
Re^2: Running Command
by Aristotle (Chancellor) on Dec 20, 2002 at 15:21 UTC
    Yuck, map in void context. :) !/^\./ and $cnt++ for readdir( DIR ); And actually, I'd rather use a grep in scalar context: $cnt = grep !/^\./, readdir DIR;

    Makeshifts last the longest.