I think it would work to put it in an eval:

if($^O =~ /Win32/)
        eval "use Win32::IProcess.pm";
}

-- Matt

On Wednesday, July 31, 2002, at 11:47 AM, Noah Hoffman wrote:

> My perl scripts are required to run on both Win machines and OS X.  
> I'm using Win32::IProcess.pm on the Win machines to do some 
> interacting with other apps.  I don't use or need it on the Mac 
> although on Classic OS I had it installed just so the perl would 
> compilte.  Now on OSX the main file won't compile because IProcess.pm 
> isn't returning true.  Is there a way for me to conditionally use the 
> perl mod depending on platform?  I tried the following:
>
> if($^O =~ /Win32/)
>       use Win32::IProcess.pm;
> }
>
> but it doesn't seem to work.
>
> Thanks,
> Noah

Reply via email to