home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / hiz / 09 / 09.exe / adynware.exe / perl / lib / site / Win32 / Sound.pm < prev    next >
Encoding:
Perl POD Document  |  1999-12-28  |  856 b   |  47 lines

  1. package Win32::Sound;
  2.  
  3. require Exporter;       # to export the constants to the main:: space
  4. require DynaLoader;     # to dynuhlode the module.
  5.  
  6. @ISA= qw( Exporter DynaLoader );
  7. @EXPORT = qw(
  8.     SND_ASYNC
  9.     SND_NODEFAULT
  10.     SND_LOOP
  11.     SND_NOSTOP
  12. );
  13.  
  14.  
  15. sub AUTOLOAD {
  16.     my($constname);
  17.     ($constname = $AUTOLOAD) =~ s/.*:://;
  18.     $!=0;
  19.     my $val = constant($constname, @_ ? $_[0] : 0);
  20.     if ($! != 0) {
  21.  
  22.  
  23.     
  24.  
  25.         ($pack, $file, $line) = caller;
  26.         undef $pack; # [dada] and get rid of "used only once" warning...
  27.         die "Win32::Sound::$constname is not defined, used at $file line $line.";
  28.  
  29.     }
  30.     eval "sub $AUTOLOAD { $val }";
  31.     goto &$AUTOLOAD;
  32. }
  33.  
  34.  
  35. $VERSION="0.03"; 
  36. undef unless $VERSION; # [dada] to avoid "possible typo" warning
  37.  
  38.  
  39.  
  40. bootstrap Win32::Sound;
  41.  
  42.  
  43.  
  44. 1;
  45. __END__
  46.  
  47.