Angharad has asked for the wisdom of the Perl Monks concerning the following question:
It doesn't work ... it skips though the . and .. files ok (I think), then passes the first set of files from the directories to the subroutine but then stops. so, out of the 6000 or so sets of files in those directories, I'm only producing results for the first lot.$dir1 = $ARGV[0]; $dir2 = $ARGV[1]; $testfile = $ARGV[2]; opendir DIR1, $dir1 or die "Can't open directory $dir1: $!\n"; opendir DIR2, $dir2 or die "Can't open directory $dir2: $!\n"; @onedir = readdir(DIR1); @twodir = readdir(DIR2); closedir DIR1; closedir DIR2; for($i = 0; $i < @onedir; $i++) { next if $onedir[$i]=~/^\./; $onefile = "$dir1$onedir[$i]"; $twofile = "$dir2$twodir[$i]"; Calc($onefile, $twofile, $testfile); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: passing number of files in directory to subroutine
by GrandFather (Saint) on Sep 23, 2005 at 10:21 UTC | |
|
Re: passing number of files in directory to subroutine
by rev_1318 (Chaplain) on Sep 23, 2005 at 10:47 UTC | |
by GrandFather (Saint) on Sep 23, 2005 at 11:34 UTC | |
by Angharad (Pilgrim) on Sep 23, 2005 at 11:45 UTC | |
by Angharad (Pilgrim) on Sep 23, 2005 at 11:08 UTC | |
by rev_1318 (Chaplain) on Sep 23, 2005 at 11:47 UTC | |
|
Re: passing number of files in directory to subroutine
by graff (Chancellor) on Sep 24, 2005 at 00:15 UTC |