From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078609810134.tru64-unix-managers.marc@archive.invalid> From: "Pam Woods, Systems Manager" Date: Wed, 05 Mar 1997 01:40:23 +0000 To: tru64-unix-managers Subject: Perl question. X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078609810134 I have a pop3 logfile of usernames by hour,min, sec. I want to do a count by hour to see how many times that specific user occurs (to see if someone has their client set for grabbing mail less than every 10 mins.) so I want to determine who's logged in over xx amount of times within any given hour. does anyone have a clue how to do this in perl? I've come close as I can count the number of occurrences for user1 for the whole file, but not by hour. So this gives me the count by username, but how do I then determine by hour by username the total? while (){ #!/usr/bin/perl # Use sysuaf mc authorize list/brief [123,*] to generate sysuaf_all.lis # and convert it into a umod username only list for batch run later. # # open(INFILE,"pop3b.out"); print OUTFILE "People who have multiple occurrances: \n"; while(){ ($dates,$time,$p3,$p4,$p5,$p6,$p7,$username) = split(' ',$_); ($hour,$min,$sec) = split(':',$time); $users[$#users+1]= $username; } #endofwhile for (@users) {$count3{$_}++; } for (sort keys %count3) { printf "\t\t%2s %5d\n",$_, $count3{$_}; } ________ Pam Woods - axsymgr@uaa.alaska.edu **** POP Users (Eudora/Netscape, etc.) ************************** Are you a DISK hog? If you haven't checked lately, please interactively log in and be sure to clean up any old files. Thanks for keeping our Disks Clean... *****************************************************************