in reply to Porting code between NT/Unix

The $^O special variable will tell you the OS you're running on, so you could do something like:
if ($^O eq 'MSWin32') { # do something Win32ish } else { # do something Unixy }
See also perlfaq8.