#!/usr/bin/perl
use strict;
my ($sec,$min,$hour,$mday,$mon,$year_off,$wday,$yday,$isdat) = localtime;
my $content = `ping 192.168.1.1 -n 5`;
my $mytime = scalar (localtime);
my $year = $year_off + 1900;
print $mytime."\n";
$mon += 1;
$mytime = sprintf("%04s%02s%02s%02s%02s%02s",$year,$mon,$mday,$hour,$min,$sec);
print $mytime."\n";
open FILE,">>D\:\\ping$mytime\.txt";
print FILE $content;
close FILE;
|