#!/usr/bin/perl # # Programmer: Craig Stuart Sapp # Creation Date: Fri May 7 13:18:49 PDT 2004 # Last Modified: Fri May 7 13:30:24 PDT 2004 # Syntax: perl 5 # # Description: Recursively search the MuseData data directory to # examine the contents of line number 5 in stage2 files. # use strict; my $item; foreach $item (@ARGV) { processItem($item); } exit(0); ######################################################################### ############################## ## ## processItem -- ## sub processItem { my ($item) = @_; if (!-d $item) { return if !-r $item; return if $item !~ /stage2/i; return if $item =~ /xxx$/i; return if $item =~ /map$/i; open (FILE, $item) || return; my @contents = ; close FILE; if ($contents[4] =~ /^WK/i) { print "$item\t"; print $contents[4]; } else { print "INVALID\t$item\t$contents[4]"; } return; } opendir (DIR, $item) || return; my @files = readdir(DIR); closedir DIR; my $file; foreach $file (@files) { next if $file =~ /^\./; processItem("$item/$file"); } }