my $device_pkg = $^O =~ /Win32/ ? 'My::SerialPort::Win32' : 'My::SerialPort::Linux'; eval "require $device_pkg" or die $@; my $device = $device_pkg->new(); $device->do_something();
In reply to Re: code that runs (and works) on both Linux and Win32
by ikegami
in thread code that runs (and works) on both Linux and Win32
by pashanoid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |