fernandes has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

 print chr hex 7 sounds a beep on the speaker. What could I do for sounding it again and again without the previous noising the next. I've yet done this:
while(1){ $a=1; while($a<1500){ print "ACORDA "; #en: WAKEUP $a++; } print chr hex 7; };
But it is clear 1500 is not recommended as a best practice. In other words, is there some objective way of wating for a beep while not shooting the next? Is this some kind of ASCII-specialized question or Perl may deal on it? Thanks!

Replies are listed 'Best First'.
Re: Waiting for another ASCII beep
by Anonymous Monk on Mar 01, 2009 at 14:49 UTC
    Get fancy :) Audio::Beep a module to use your computer beeper in fancy ways
Re: Waiting for another ASCII beep
by zentara (Cardinal) on Mar 01, 2009 at 15:06 UTC
    You could also use Flite to count with a voice, and get rid of that annoying beep. :-) Also remember, some terminals have the beep turned off with a software switch.
    my $count = 0; while(1){ sleep 1; system ( "flite -t $count" ); # may need cleaner options $count++; }

    I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness
Re: Waiting for another ASCII beep
by MidLifeXis (Monsignor) on Mar 01, 2009 at 16:04 UTC

    Some terminals will swallow the previous beep, others will wait, some will turn it off, and still others will merge the current sound and pending sounds together.

    In summary - find something specific for the output device you are looking to use. At least in this case.

    --MidLifeXis

Re: Waiting for another ASCII beep
by Anonymous Monk on Mar 01, 2009 at 14:49 UTC
    sleep, or select
    perl -le " while(1){ select(undef, undef, undef, 0.25); print chr 7 } +"