in reply to Coding for two platforms in one Script

I've never used autouse, but I suspect you're having problems with the fact that use happens too early. You probably need to move them to a BEGIN block (which is where use "executes"). Something like this may work:

BEGIN { if ($^O eq "MSWin32") { use Win32::EventLog qw(Report new); } else { use Sys::Syslog qw(:DEFAULT setlogsock); } } # later... if ($^O eq "MSWin32") { my $eventlog = Win32::EventLog->new("myscript"); } else { Sys::Syslog::setlogsockt ('unix'); Sys::Syslog::openlog ("myscript", 'pid', "INFO"); }
(warning, this is untested.)

HTH