in reply to Portability question: Is there something like '#ifdef' in Perl?

Use $^O. It holds the name of the OS you're currently running on, and you can use it in conditional code all you like. It's the traditional way to do this sort of thing in perl. For conditional inclusion, throw things in a BEGIN block with require and import:
BEGIN { if ($^O eq 'Win32') { require Win32::Foo; import Win32::Foo; } elsif ($^O eq 'Linux') { require Linux::Foo; import Linux::Foo; } }
  • Comment on Re: Portability question: Is there something like '#ifdef' in Perl?
  • Download Code