in reply to Re: Can we do "use Win32:Service" on Unix ?"
in thread Can we do "use Win32:Service" on Unix ?"

Thanks, This works on unix pretty well, but when run on windows it cribs with this error message - Win32::Service did not return a true value at .... The point is, we need this work on both windows and unix. Is there a way out ? pls lemme know. -ajith.
  • Comment on Re^2: Can we do "use Win32:Service" on Unix ?"

Replies are listed 'Best First'.
Re^3: Can we do "use Win32:Service" on Unix ?"
by Corion (Patriarch) on Jan 27, 2005 at 15:19 UTC

    Sorry - I gave you some wrong information. The use command does not return the true value that require returns. So you need to throw out the second line that contains did not return a true value of my code:

    use strict; if ($^O =~ /MSWin32/) { my $res = eval "use Win32::Service"; die $@ if $@; # do Windows code } else { # Assume Unix, even though there are other platforms # do Unix code };
      Hi All, Thanks much for all the replies. MY SCRIPT WORKS !! Perl monks ROCK !! thanks again ! -ajith.