Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks for the help!#!/usr/bin/perl use strict; use warnings; my $dir = "/mydir"; my $counter=0; opendir(DIR, $dir) or die $!; while (my $file = readdir(DIR)) { # just files next unless (-f "$dir/$file"); $counter++; print "$counter of $counter - $file\n"; } closedir(DIR); exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Counting files in directory.
by MidLifeXis (Monsignor) on Sep 22, 2011 at 18:16 UTC | |
by Anonymous Monk on Sep 22, 2011 at 18:44 UTC | |
by Anonymous Monk on Sep 22, 2011 at 19:13 UTC | |
by chromatic (Archbishop) on Sep 22, 2011 at 19:38 UTC |