use warnings;
use strict;
####
use Time::Local;
$today = timelocal(localtime);
####
$today = time;
####
$datafile=`cat ../hosts/iplist.txt | sort -r | sort -u -t ',' -k 2,2 > ../hosts/latestip.txt`;
####
$datafile = `sort -r ../hosts/iplist.txt | sort -u -t ',' -k 2,2 > ../hosts/latestip.txt`;
####
my $count = 0;
####
open (DATA,"/home/myplace/hosts/latestip.txt") || die ("Can't Open data File \n");
@data=;
close DATA;
####
open PIPE, '-|', 'sort -r ../hosts/iplist.txt | sort -u -t ',' -k 2,2'
or die "Cannot open pipe from sort because: $!";
while ( ) {
# do your stuff here
}
close PIPE or warn $! ? "Error closing sort pipe: $!"
: "Exit status $? from sort";
####
$x=0;
####
sub header_response
{
print "Content-type: text/html\n\n";
print "test\n";
print "\n";
print qq^\n^;
print "Our IP Info
\n";
print "
\n";
print "\n";
print "| Host Name | IP address | Last Boot Windows |
\n\n";
return;
}
sub footer_response
{
print "
\n";
print "
\n";
print " \n";
return;
}
####
print <<'HTML';
Content-type: text/html
test
Our IP Info
| Host Name | IP address | Last Boot Windows |
HTML
print <<'HTML';
HTML