my $OS = $^O; if ($OS =~ m/win32/i) { eval "use Win32::File"; eval "use Win32::FileSecurity"; } if ($OS =~ /darwin/) { do something else } if ($OS =~ m/win32/i) { my $attrib; Win32::File::GetAttributes($http_rec_localdir, $attrib); if ($attrib & (Win32::File::SYSTEM | Win32::File::HIDDEN)) { &error_dialog( "Destination Directory", "Destination directory is not writable." ); return; } }