Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The script:Total Count = 0 #I want the total count of 5 here. . .. file1 file2 file3 Total count = 5 #I want this total count up on the top of output inst +ead of here.
use strict; my $newfile = "./"; opendir(DIR,$newfile); my @files = readdir(DIR); close(DIR); my $ct = 0; chdir ($newfile) || die "Could not change to $newfile directory\n$!\n" +; print "Total count = $ct\n\n"; for(@files) { print "$_\n"; $ct++ } print "\nTotal count = $ct\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need counter assistance
by RMGir (Prior) on Aug 30, 2002 at 12:58 UTC | |
by Anonymous Monk on Aug 30, 2002 at 13:47 UTC | |
by RMGir (Prior) on Aug 30, 2002 at 13:55 UTC | |
by Anonymous Monk on Aug 30, 2002 at 14:01 UTC | |
by cfreak (Chaplain) on Aug 30, 2002 at 13:57 UTC | |
|
Re: Need counter assistance
by simeon2000 (Monk) on Aug 30, 2002 at 12:53 UTC |