I've written a simple bird-call quiz in Perl/Tk with the goal of making
it work under both Linux and Windows with ActivePerl. It's all working
except for sound. How can I make it load the Win32::Sound module only
if it's running in Windows?
My first try was the following:
$OSVERSION=$^O;
if ("$OSVERSION" eq "linux") {
print "Using Linux sound modules.\n";
$splitter='/';
} else {
print "Using Windows sound modules.\n";
use Win32::Sound;
$splitter='\\';
}
But the result was the compiler caught the "use" statement and always
tried to load the Win32::Sound module no matter what the surrounding
logic. I've studied the Camel book but haven't found the equivalent of
an "IFDEF" command. Is there one, or is there a better way to do it?
--
Carl Patten <myok at ogzr.org>
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list