sub readConfig { if ($^O eq "MSWin32") { use Win32::TieRegistry; # read some stuff from registry } else { open (CONFIG, '/etc/something') or die "$!:Blech\n"; # read some config info in } return "something important"; }