Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Help needed with WIN32::Service

by the_hawk_1 (Scribe)
on Jun 28, 2010 at 19:44 UTC ( [id://846971]=note: print w/replies, xml ) Need Help??


in reply to Re: Help needed with WIN32::Service
in thread Help needed with WIN32::Service

Thanks NetWallah, but I forgot to mention that when I try this directly on the machine, it works well, but I can't do it remotly.

So, I'm sure about the service name.

I've also tried with the '\\\\' or the ip address, but both didn't work neither.

Replies are listed 'Best First'.
Re^3: Help needed with WIN32::Service
by NetWallah (Canon) on Jun 28, 2010 at 20:03 UTC
    Is there any indication in the "die" error message as to what the problem is ?

    How about the event logs, particularly the security logs ? There could be firewall or authentication issues.

         Syntactic sugar causes cancer of the semicolon.        --Alan Perlis

      The die message is empty! I really don't understand what's going on...

      Also, I can't figure out where the log are on my WinXp pro, running ActivePerl...

        You can use the "event viewer" to track logged error and status messages. From a command prompt, or the "Run" dialog, type "eventvwr" to bring up the event viwer, and examine recent APPLICATION and SECURITY messages.

        Re: Getting perl to report errors - as others have indicated, the Win32:: code apparently does not place the errors in $!.

        Instead, you need something like:

        use Win32::Service; use Win32; ... if (! Win32::Service::GetStatus($host, $serviceName, \%status)){ die "Cannot get $serviceName status : $!\nWin Error:" . Win32::GetL +astError() . "\n"; }

             Syntactic sugar causes cancer of the semicolon.        --Alan Perlis

        When you say 'die message', do you mean the $! variable. If so, you may need to examine the $^E instead, as some Win32:: modules set this instead when there is an error.

        You could also try dumping the hash returned by the GetStatus() function to what it contains, using something like the Data::Dump module.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://846971]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-19 09:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found