#!/usr/local/bin/perl use File::Find; $dirname=argv[]; my ($maxwidth)=0; my (%cmTime,%hMtime,%oMtime); my ($file,$base,$fmt); opendir(DIR, $dirname) or die "can't opendir $dirname: $!"; while (defined($file = readdir(DIR))) { next unless ($base)=$file=~/(.+)\.txt$/; open (fh, ">", $file) or die "Can't openfile $file: $!"; while () { chomp; ($timestamp,@fields)=split/,/; } close (fh) or die "unable to close $file: $!"; $actioncode=$timestamp; if ($actioncode='Login') { print "found login"; } print ("succesfully opened file"); print("$file \n"); } closedir(DIR);