[EMAIL PROTECTED] wrote: > > My problem is that I would like to have only > one script (to simplify maintanence and deployment) > for all OSs. So, for example, for Win32 machines > I may need Win32::API and Win32::DriveInfo; if I > use this contstruct: > > ... > if ($^O eq 'MSWin32') { > use Win32::API; > use Win32::DriveInfo; > ... > } ... > > the script doesn't compile under non-Win32 systems.
You can use require/import in a BEGIN block, and in 5.8.0 there is also --> use if $^O eq "MSWin32" => Win32::API; use if $^O eq "MSWin32" => Win32::DriveInfo; -- Steve perldoc -qa.j | perl -lpe '($_)=m("(.*)")' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]