in reply to How to have OS specific code sections in Perl
use warnings; use strict; my $LINUX = 0; if ($^O eq 'linux') { $LINUX=1; }; use if $LINUX, 'MIDI::ALSA' => ('SND_SEQ_EVENT_PORT_UNSUBSCRIBED', 'SND_SEQ_EVENT_SYSEX'); if ($LINUX) { print STDERR "OS is Linux\n"; MIDI::ALSA::client('test',1,1,1); MIDI::ALSA::connectfrom(0,'MidiSport 4x4:0'); MIDI::ALSA::connectto(1,'MidiSport 4x4:0'); MIDI::ALSA::start(); }
UPDATE: deleted 2nd 'use'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to have OS specific code sections in Perl
by aitap (Curate) on Oct 31, 2012 at 18:54 UTC | |
by perltux (Monk) on Oct 31, 2012 at 19:02 UTC | |
|
Re^2: How to have OS specific code sections in Perl
by perltux (Monk) on Oct 31, 2012 at 17:36 UTC | |
by toolic (Bishop) on Oct 31, 2012 at 17:43 UTC | |
|
Re^2: How to have OS specific code sections in Perl
by perltux (Monk) on Oct 31, 2012 at 18:43 UTC | |
|
Re^2: How to have OS specific code sections in Perl
by perltux (Monk) on Oct 31, 2012 at 18:00 UTC | |
by tobyink (Canon) on Oct 31, 2012 at 18:44 UTC | |
by Anonymous Monk on Nov 01, 2012 at 00:56 UTC |