#!/usr/local/bin/perl -w @files = glob("*"); $i = 0; foreach $f (@files) { if (-f $f) {$i++} } print "num plain files: $i\n";