Hi there,

I have a perl script that will run on both Unix and Windows platforms, the only problem I am having is below:

use Win32::Process;

I have to use the above only for windows since later in my script:
if ($platform eq 'UNIX') {
           system("$Cmd > /dev/null 2>&1 &");
}
       elsif ($platform eq 'WINDOWS') {
Win32::Process::Create($process,"$^X","$^X" . " $Cmd",0, CREATE_NO_WINDOW, ".") || die $!;
}


I don't want to maintain two scripts, and it seems I cann't do something like this on the top of the script:
if ($platform eq 'WINDOWS') {
   use Win32::Process;
}


Anyone can help?

NOTE: regarding the above platform variable, it is defined on the top of the script:
($^O =~ /Win32/) ? ($platform = 'WINDOWS') : ($platform = 'UNIX');


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to