<?xml version="1.0" encoding="windows-1252"?>
<node id="995566" title="Not able to start a service in my computer" created="2012-09-25 11:14:25" updated="2012-09-25 11:14:25">
<type id="115">
perlquestion</type>
<author id="991836">
kalyanbhave</author>
<data>
<field name="doctext">
&lt;p&gt;
Hi,

I am not able to start a service in my machine using the below code&lt;/p&gt;
&lt;code&gt;

  #!/usr/bin/perl
     use strict;
     sub StartServ 
	 {
 
     $computername = '';
     $servicename = 'ProtectedStorage';
 
     Win32::Service::GetStatus("\\\\".$computername, $servicename, \%status);
     die "service is arealdy started\n" if ($status{CurrentState} == 4);
 
     Win32::Service::StartService("\\\\".$computername,$servicename) || die "Can't start service\n";
     print "Service started\n";
     }

&lt;/code&gt;

Error:- 
Global symbol "$computername" requires explicit package name at xxx.pl line 6
Global symbol "$servicename" requires explicit package name at xxx.pl line 7.

When I tried downloading the Service module which cantails packages, i am not able to execute it.
please provide me the steps to execute and run the module..

Thanks
</field>
</data>
</node>
