FireyIce01 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use File::stat; use Date::Manip; # This is a program that is intended to allow FEP operators # a tool that will facilitate in monitoring incoming transmissions # and preprocessor logs. #------------------- Define Subroutines ------------------# # # # Main is a subroutine simply written for flow control sub Main { my $corp = $_[0]; print "Logs:\n"; farmInput($corp, 'farm/*/*/log/'); print "Input:\n"; farmInput($corp,'farm/*/*/input/'); print "Save:\n"; farmInput($corp, 'farm/*/*/input/save/'); print "Failed:\n"; farmInput($corp, 'farm/*/*/input/failed/'); } # end Main # This subroutine takes 2 input variables, the corp (or any text you w +ant to find) # and the path in which to search (with /usr/local/ being the root of +the search) sub farmInput { my($corp, $finalPath) = ($_[0], $_[1]); my $path = "/usr/local/$finalPath*$corp*"; my @farms = glob($path); foreach my $farm (@farms) { my $s = stat($farm); printf "%s\nAge[%s] size[%s]\n", $farm, ParseDateString("epoch".$s +->mtime()), $s->size(); # the above line does the same thing as the next 4 commented lines # printf "%s: Age [%s], size[%s]\n", # $farm, # DateCalc( "Jan 1, 1970 00:00:00 GMT",$s->mtime() ), # $s->size(); } # end of foreach statement } # end farmInput #------------------- End Subroutines ---------------------# print "What corp are you looking for? " ; chomp(my $whatWeWant = <STDIN>); Main($whatWeWant);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: SSH compatibility without external modules?
by sasikumar (Monk) on Jan 18, 2005 at 10:31 UTC | |
|
Re: SSH compatibility without external modules?
by simonm (Vicar) on Jan 18, 2005 at 17:51 UTC | |
|
Re: SSH compatibility without external modules?
by hostyle (Scribe) on Jan 18, 2005 at 22:38 UTC | |
by FireyIce01 (Novice) on Jan 19, 2005 at 07:00 UTC |