#!/usr/local/bin/perl # # pro_file_list.pl # 29May97/srg # # moc/pro file name list routine # generates a list of ".pro" files found # in /data2/gbdata and prints them to stdout # #some definitions $topdir="/data2/gbdata"; # set data top directory #print "DEBUG/TopDir: $topdir\n"; chdir($topdir) or die "Cannot change to $topdir directory"; foreach $cruise_dir (<$topdir/*>) # get topdir filenames one at a time { # print "\n\nDEBUG/Crs_Dir: $cruise_dir\n"; $moc_dir = "$cruise_dir/moc"; # add /moc to the name # print "DEBUG/Moc_Dir: $moc_dir\n"; if(-e $moc_dir) # check if it exists and process { # o/p err msg if doesn't?? foreach $pro_file (<$moc_dir/*.pro>) # get the .pro files { # err msg if no pro's?? # print "DEBUG/Pro_file: $pro_file\n"; push (@pro_file_list, $pro_file); # push onto a list } } } # have list of all .pro files found - list them $nfiles = @pro_file_list; # get a count of files print "DEBUG/Number of Elements: $nfiles\n"; foreach $pro_file (@pro_file_list) { print "DEBUG/Pro_File_List: $pro_file\n"; }