in reply to mention a non-installed module in script

BEGIN { if ($os =~ /Win/i){ eval "use Win32::SerialPort; 1" or die $@; } else { eval "use Device::SerialPort; 1" or die $@; } }

Note: I removed the buggy /g. if (/.../g) not only makes no sense, it can be harmful.

Replies are listed 'Best First'.
Re^2: mention a non-installed module in script
by pashanoid (Scribe) on Jun 16, 2011 at 03:23 UTC
    Thank you, worked like a charm!