The Win32::Service module only works on Windows, and not on Unix. But you can prevent loading the module if your script is running under Unix like this:
use strict; if ($^O =~ /MSWin32/) { my $res = eval "use Win32::Service"; die $@ if $@; die "Win32::Service did not return a true value" unless $res; # do Windows code } else { # Assume Unix, even though there are other platforms # do Unix code };
In reply to Re: Can we do "use Win32:Service" on Unix ?"
by Corion
in thread Can we do "use Win32:Service" on Unix ?"
by ajith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |