[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Platform Independent way to beep?



At 18.41 -0400 1999.04.28, Jim Correia wrote:
>But that doesn't work on systems that don't have the mac modules
>installed.
>
>So how do i do it?

I believe \a (I use \007) is the only option.  Some places will not work
(some you've mentioned, and terminals that for some reason don't recognize
it).  If there is another way, I'd be surprised, but I'd like to know, too.
:)

But you could special-case it:

if ($^O eq 'MacOS') {
  require Mac::Sound;
  Mac::Sound::SysBeep(0);
} else {
  print "\007";
}

Then if others come along that have other ways of doing it, you can add
those in with elsifs.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org