if($^O =~ /mswin32/i) { require Win32::Process; # do the task using Win32::Process } else { # do the task using whatever it is that works on linux }