Hi Dave. That routine was great. Took the guts from it and ended up with below. Im having a wee problem getting my head around printf( as in it would be good to be able to have each information on a new line, but using formatters \r overwrites a line and \n because its re-entrant just scrolls each time it enters. So Ive ended up with a single line:
#Hook information subroutine
use Hook::WrapSub qw(wrap_subs);
use IO::Handle;
use Time::HiRes qw(gettimeofday);
my $t0 = gettimeofday( );
my $FDcount = 0;
sub after_dircopy {
my $t1 = gettimeofday( );
my $elapsed = $t1 - $t0;
printf("\rElapsed time since start: H%02d:M%02d:S%02d Number of files
+and directories processed: %02d Ctrl-C breaks",
($t1 - $t0) / (60*60),
($t1 - $t0) / ( 60) % 60,
($t1 - $t0) % 60,
++$FDcount);
STDOUT->flush;
}
wrap_subs sub {}, 'File::Copy::Recursive::fcopy',\&after_dircopy;