Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.36 KB | None | 0 0
  1. for (my $i=1; $i<scalar @time; $i++) {
  2.         #my ($h, $m, $s) = split(/:/, $current_time);
  3.         @t1 = split(/:/, $time[$i-1]);
  4.         @t2 = split(/:/, $time[$i]);
  5.        
  6.         $prev = $t1[0] * 3600 + $t1[1] * 60 + $t1[2];
  7.         $actual = $t2[0] * 3600 + $t2[1] * 60 + $t2[2];
  8.         $odds = $actual - $prev;
  9.         if ( $odds < 2 ) {
  10.             print $ip[$i] . "\t" . $odds . "s" .  "\n";
  11.         }
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement