I'm working on a script that parses a log file which gives connection time
in seconds.  Below is how I resolved the problem but I think there must be
a better way?

#!/usr/bin/perl -w

use strict;

my $sessionTime = 4000;

my $hour = $sessionTime / 3600;
my $hr = int($hour);
$sessionTime = $sessionTime - ($hr * 3600);
my $minute = $sessionTime / 60;
my $min = int($minute);
my $sec = $sessionTime - ($min * 60);
print "$hr hour $min minutes and $sec seconds.\n"


Rob

Good judgement comes from experience, and experience -
well, that comes from poor judgement.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to