Veli-Pekka Tätilä wrote:
> $Bill Luebkert wrote:
>> Veli-Pekka Tätilä wrote:
>>> problem is how do I wrap PPM so that I can both read from and write to
>>> it?
>> Why not just modify this code in ppm3-bin starting around line 3109 :
> Well, I was hoping for a more generic solution so I might learn  something 
> new in the process, too. Modding the app itself is certainly the most 
> straight forward approach and it works.
> 
> As I'd like to keep the original ppm script in tact, I did another one that 
> reads it in, modifies the line in question and runs the result through eval. 
> I tried it out and it beeps when expected. Though I must say the default 
> WIndows or Linux beep is not too pleasant. But I guess I'm too lazy to wrap 
> the Win32 Beep function using Win32::API as the package upgrade is something 
> I do maybe once a month.

Here's some beep code you can easily modify:

#!perl --

use strict;
use warnings;
use Win32::API;

use constant DEFAULT => 0xFFFFFFFF;             # Std speaker beep
use constant MB_OK => 0x00000000;               # SystemDefault
use constant MB_ICONHAND => 0x00000010;         # SystemHand
use constant MB_ICONQUESTION => 0x00000020;     # SystemQuestion
use constant MB_ICONEXCLAMATION => 0x00000030;  # SystemExclamation
use constant MB_ICONASTERISK => 0x00000040;     # SystemAsterisk

Win32::API->Import('user32', 'BOOL MessageBeep (UINT uType)') or
  die "import MessageBeep: $! ($^E)";

for (DEFAULT, MB_OK, MB_ICONHAND, MB_ICONQUESTION, MB_ICONEXCLAMATION,
  MB_ICONASTERISK, ) {
        my $ret = MessageBeep ($_);
        sleep 2;
}

__END__

> Does eval affect performance much? My first guess is no because Perl is 
> mostly interpreted or so I've understood it. And secondly, in downloading 
> packages, bandhwidth appears to be the real bottleneck anyway.
> 


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to