I am trying to play with Windows Services in Perl. I installed
Win32::Service::Daemon, but when running the test script I get: "Undefined
subroutine &Win32::Service::Daemon::CreateService called at C:\Documents and
Settings\Tal Cohen\Desktop\Win32-Daemon\test\TEST.PL line 11." 

 

Here is the test script:

 

use Win32::Service::Daemon; 

 

%Hash = (

    name    =>  'PerlTest',

    display =>  'Oh my GOD, Perl is a service!',

    path    =>  'C:\Perl\bin\perl.exe C:\Documents and Settings\Tal
Cohen\Desktop\Win32-Daemon\test\Daemon.pl',

    user    =>  '',

    pwd     =>  '',

);

 

if( Win32::Service::Daemon::CreateService( \%Hash ) )

{

    print "Successfully added.\n";

}

else

{

    print "Failed to add service: " . GetError() . "\n";

}

 

 

 

print "finished.\n";

 

sub DumpError

{

    print GetError(), "\n";

}

 

sub GetError

{

    return( Win32::FormatMessage( Win32::Service::Daemon::GetLastError() )
);

} 

 

Can anyone help?

 

Thanks, 

Tal

 

 

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to