aboutsummaryrefslogtreecommitdiffstats
path: root/ipchanges.pl
blob: 5b3211a0b666e4af243af1baad12769e8538e7dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

my $file = "/home/lookshe/myips.txt";

open(FILE, $file) || die("unable to open $file!");
my @lines = <FILE>;
close(FILE);

for ($i = 1; $i <= $#lines-2; $i+=2)
{
   my $ip = $lines[$i];
   chomp($ip);
   my $nextip = $lines[$i+2];
   chomp($nextip);
   if ($ip !~ m/^$nextip$/)
   {
      my $time = $lines[$i+1];
      chomp($time);
      print "$time: $ip -> $nextip\n";
   }
}