in reply to Common use statements for windows and Linux

See use and require.

Basically, use is compile-time and will happen before you assign any variables, so use $OsDep will not work. I would rewrite the code to:

if (...) { require Win32::EventLog; Win32::EventLog->import(); } elsif (...) { require File::Copy; File::Copy->import(); } else { warn "Unknown OS $^O detected, using default module(s)."; require File::Copy; File::Copy->import(); };