At 9:42 +0000 21/11/02, John Delacour wrote:
Now why don't I get a bell but when I do ( print "\a" ) or ( print \007 ) in 10.2.2/Perl5.8.0? It works fine in MacPerl and no character is "printed" but in OS 10 the only way I've found is:Remember, with perl, There Is More Than One Way To Do It.
$/ eq "\015" and `osascript -e beep` ;
which slows things down a lot.
Just forget about printing the bell character and hoping whoever is listening will do something, instead, beep yourself:
#!/usr/bin/perl -w
use strict;
use Inline C => 'DATA',
LDDLFLAGS => '-bundle -flat_namespace -undefined suppress -framework Carbon',
INC => '-I/Developer/Headers/FlatCarbon';
beep();
__END__
__C__
#undef Move
#include <Sound.h>
void beep()
{
SysBeep( 1 );
}
I take no claim of cleverness on this solution, it is copied directly from Chris Nandor's gestalt example, especially the required "#undef Move".
Enjoy,
Peter.
--
<http://www.interarchy.com/> <http://download.interarchy.com/>