I'm to figure out how to make code work across different platforms. To do this I need
to determine if the $^O variable is "MSWin32", then 'use Win32::Sound' if it is.
I realize that 'use' is grabbed at compile time...so I tried the following.
if ($^O eq "MSWin32"){
require 'Win32::Sound';
# There doesn't seem to be an import sub in the Sound.pm file
}
Then when I do a:
Win32::Sound::Play("$cfghash{SOUND_DIR}/$soundfile",SND_ASYNC);
it plays the sound...but does NOT play it asynchronously. Rather, the program pauses
until the sound has finished playing. I assume this is because the SND_ASYNC wasn't
recognized.
If I do a:
use Win32::Sound;
then everything works fine. But I know of no way to include a 'use' statement under a
conditional statement.
Please help if you can.
Jack
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]