Can anyone tell me how to make my program run hourly, i am useing windows so i cannot use the 'cron' program. Shall i use an outside windows program or is there a hourly loop command built into pearl? I don't really want to use another cpan pearl module unless its absolutely neccessary. This is the code i am going to run hourly any way if it helps:--
use Win32:rocess::Info; #Requests to use the Win32 Mod
use Date::EzDate; #Requests to use the date mod
use Date::WeekOfYear;
use warnings;
my $printinfo = Win32:rocess::Info->new(); #Gets the system process info
my @info = $printinfo->GetProcInfo(); #Stored to an array
my $currentdate = Date::EzDate->new(); #Loads the current Date an Time
my $weekNo = WeekOfYear();
$file = "$weekNo $currentdate->{'{hour}{_%d_%h}'}.txt"; #Names file with week no hour date
$logfile = ">/perl/ass/$file"; #Open file for writing to
open(LOG, $logfile);
print LOG "$weekNo \n";
print LOG $currentdate->{'{day of month}/{month number base 1}/{year two digits}'}, "\n" ,
$currentdate->{'clocktime'}, "\n \n"; #Prints the current date to *.txt
for $pid (@info) #For all information in the array
{
print LOG $pid->{"Name"}."\n"; #Print it to the log file
}
print "Log Successfully created for: $currentdate\n";
close(LOG);
use Win32:rocess::Info; #Requests to use the Win32 Mod
use Date::EzDate; #Requests to use the date mod
use Date::WeekOfYear;
use warnings;
my $printinfo = Win32:rocess::Info->new(); #Gets the system process info
my @info = $printinfo->GetProcInfo(); #Stored to an array
my $currentdate = Date::EzDate->new(); #Loads the current Date an Time
my $weekNo = WeekOfYear();
$file = "$weekNo $currentdate->{'{hour}{_%d_%h}'}.txt"; #Names file with week no hour date
$logfile = ">/perl/ass/$file"; #Open file for writing to
open(LOG, $logfile);
print LOG "$weekNo \n";
print LOG $currentdate->{'{day of month}/{month number base 1}/{year two digits}'}, "\n" ,
$currentdate->{'clocktime'}, "\n \n"; #Prints the current date to *.txt
for $pid (@info) #For all information in the array
{
print LOG $pid->{"Name"}."\n"; #Print it to the log file
}
print "Log Successfully created for: $currentdate\n";
close(LOG);