No....plesae, don't remove the colon. You will get the wrong result surely... maybe let's think about in this way...
my ($hhA, $mmA, $ssA, $hsA ) = split (/\:/, $tableA{$key}); my ($hhB, $mmB, $ssB, $hsB ) = split (/\:/, $tableB{$key}); my $timeA = $hsA + $ssA*100 + $mmA*100*60 .....; my $timeB = $hsB + $ssB*100 + $mmB*100*60 .....; ### so let your time at a common unit , ie. hs #### $diff = $timeA - $timeB; Maybe there are some modules can do this job for you to compair the timestamp, but I don't know ... =) Anyway, thanks for telling me what's time stamp... Rgds, Connie ----- Original Message ----- From: [EMAIL PROTECTED] To: Connie Chan Sent: Tuesday, July 16, 2002 6:55 PM Subject: Re: cross referencing hashes Had a good look at this now, actually, all I need is the $diff, but the issue I guess is that the format of the time stamp wont allow for a simpe subtraction. I suppose I could remove the colons then do the subtraction, and reformat if neccesary, thanks, Ad "Connie Chan" <[EMAIL PROTECTED]> 16/07/2002 18:41 ZE8 To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> cc: bcc: Subject: Re: cross referencing hashes but I don't know what is time stamp =) are these integers ? Would this help : my %tableA = (..... ); my %tableB = (......) ; my %comp = ( ); foreach my $key(keys(%tableA)) { my $diff = $tableA{$key} - $tableB{$key}; $comp{$key} = $diff; } Is %comp the stuff you want ? Rgds, Connie ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 16, 2002 6:01 PM Subject: cross referencing hashes > hi, > > I have 2 seperate hash tables both of which have the same keys but the > values are different. The values are time stamps. what I want to do is > for each key subtract the differnce between the 2 time stamps. any ideas? > > thanks, > Adrian > >