bcrowell2 has asked for the wisdom of the Perl Monks concerning the following question:
Basically I have a piece of software here containing a module Browser.pm. It's been running fine for me on FreeBSD with perl 5.8.5 (and also on some earlier versions of perl), and I have users running it ok on Mandrake and Windows. However, I find that on perl 5.8.4 on Debian-Sarge, if I do "perl -c Browser.pm", perl goes into an endless loop, eating CPU like crazy. I'd appreciate it greatly if anyone could supply more data points, by downloading the tarball and running a perl -c on it on their own system. At this point I'm not sure if (a) it's a bug in perl 5.8.4 that was fixed in 5.8.5, (b) it's a bug in the version of perl being distributed with Debian-sarge, or (c) there's something else going on that I don't understand. If it's a, then I guess I just post a notice on my web page saying my software is known not to work with 5.8.4. If it's b, then maybe I should report it as a bug to Debian. If it's c, then maybe it's a bug in perl that I should report, or...?
TIA!
Thanks, all, for your help! The suggestion about the BEGIN block was bang on -- I'd been assuming that Perl would just be checking the syntax, didn't realize it was doign the BEGIN blocks. The following turns out to be a somewhat more minimal example:
Interestingly, it seems to be very hard to take any code out of this without curing the bug. So the long and the short of it seems to be that it's a bug in Audio::Data.eval "use Audio::Data"; my ($server,$sound); eval { # Don't crash and burn if they don't have Audio installed. my $silent = Audio::Data->new(rate=>44100.); my $shk = Audio::Data->new(rate=>44100.); my $delay = 0.06; # so it doesn't occur at the same instant as the + sound of the clicking key my $duration = 0.05; $silent->silence($delay); $shk->noise($duration,1.6); my $n = $shk->samples; my $attack_frac = .1; for (my $i=0; $i<=$n; $i++) { my $attack = 1.; if ($i<$n*$attack_frac) {$attack=$i/($n*$attack_frac)} my $tail = ($n-$i)/$n; my $env = $attack*$attack*$tail*$tail*$tail; $shk->[$i] *= $env; } $sound = Audio::Data->new(rate=>44100.); $sound = $silent . $shk; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: bug in perl 5.8.4?
by conrad (Beadle) on Dec 07, 2004 at 12:08 UTC | |
|
Re: bug in perl 5.8.4?
by fraterm (Scribe) on Dec 07, 2004 at 05:42 UTC | |
by bcrowell2 (Friar) on Dec 07, 2004 at 05:55 UTC | |
by fraterm (Scribe) on Dec 07, 2004 at 15:48 UTC | |
|
Re: bug in perl 5.8.4?
by PreferredUserName (Pilgrim) on Dec 07, 2004 at 15:49 UTC |