in reply to how to get total numbers of files in a directory?
Of course, this will only skip directories. If you want to avoid other kinds of files, you should take a look at perldoc -f -X. Welcome to The Monastery.#!/usr/bin/perl -w use strict; my $total; for ( glob ('/home/a/*.txt') ) { $total++ if ! -d; } print "The total is $total\n";
Cheers - L~R
|
|---|