#!/usr/bin/perl ############################################################################################################### # count_tool.pl # Description: This tool count all Lines in a File beginning with 1L and writes a Mail if the count is # over a specific Limit # Author: Ulrich Kehder ############################################################################################################### #-------------------------------------------------------------------------------------------------------------- # Definition of libraries and global variables #-------------------------------------------------------------------------------------------------------------- my $VERSION = "1.0.0.0"; # versionnumber of this tool # default libraries use 5.008; # perl version 5.8 is required use strict; # use strict conditioning use warnings; # output optional warnings # default variable my @Zeilen = (); $ENV{"ENV"} = ""; $ENV{"PATH"} = "/usr/bin"; ############################################################################################################### # MAIN program ############################################################################################################### # lexical filehandle; 3-argument-open, and use $! for error diagnosis open( my $countfile, "<", "/nhdata/pptoll.310") || die "Konnte Counter-Datei nicht oeffnen: $!\n"; # Open to Read or close and End Program while(<$countfile>) { if ( "01L" eq substr( $_, 0, 3 ) ) { print $_; } } close($countfile);