the total time is almost figured out ; i cant seem to think of a way to get process time without writing inefficient & repetitive code :(
Congratulations, you are about to start programming, start naming subroutines, subroutines that take arguments and return values, and die on critical errors (like can't open file), subroutines with meaningful names that make sense in the context of your application, subroutines whose names are part of your application vocabulary/glossary
perlintro#Writing subroutines and http://learn.perl.org/books/beginning-perl/ Chapter 8: Subroutines