in reply to code that runs (and works) on both Linux and Win32
Perosnally I use the if pragma for loading modules. I put platform specific code into subroutines, and call via a dispatch table:
(With suitable checks at load time to ensure $^O is a key to %g_dt)# simplified my %g_dt = (MsWin32 => \&WinStuff, linux => \&LinuxStuff, # and so on ); ... # The call $g_dt{$^O}->(args);
|
---|
In Section
Seekers of Perl Wisdom