#!usr/bin/perl use modules XYZ while(1){ DO ABC } #### MyService.pl package PerlSvc; $PerlSvc::Name = "MyService"; #Short name by which your service is known. $PerlSvc::DisplayName = "MyService Display"; #Display name in Windows Control Panel. sub PerlSvc::Startup(){ #Function called when the service is started. my $exitloop = 1; my $sleep = 1; while ($exitloop) { $outputFile = "C:/TEMP/Perl/myservice.log"; if(!open(myOutput, ">>$outputFile ")) { print("Could not open".$outputFile); } print(myOutput localtime(time)."\n"); print localtime(time)."\n"; close(myOutput ); sleep $sleep; } }