New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTRL-C handler under Windows fails to terminate gracefully when invoked during an inner loop including a next LABEL to an outer loop. #11692
Comments
From daoswald@gmail.comBut report attached as a text file entitled "primebugreport.rep" See http://www.perlmonks.org/?node_id=930504 for more details. -- David Oswald |
daoswald@gmail.com - Status changed from 'new' to 'open' |
daoswald@gmail.com - Status changed from 'open' to 'new' |
From @jkeenanSince the attachment did not end in an extension which RT is programmed to render as text, it's likely that few people saw this ticket when it originally appeared more than 5 years ago. Here it is. James E Keenan (jkeenan@cpan.org) ########## This is a bug report for perl from daoswald@gmail.com, This problem appears specific to Windows implementations of Perl, and seems Attached is a sample "prime number generator" that uses "last LABEL" to jump There is a writeup of this problem here: http://www.perlmonks.org/?node_id=930504 Here is sample code: use strict;
use warnings;
use v5.12;
use constant TOP => 1000000;
say "1 is prime.";
say "2 is prime.";
my $found = 2; # We already found 1 and 2.
OUTER: for( my $i = 3; $i < TOP; $i += 2 ) {
for( my $j = $i - 2; $j > 1; $j -= 2 ) {
( not $i % $j ) && next OUTER;
}
say "$i is prime.";
$found++;
}
say "Found $found primes between 1 and ", TOP, ".\n"; Assuming user types CTRL-C to terminate this program, about a third of the Most of the time the error involves "Out of memory!", and some of the time I tried to think of a way to create a rock-solid test to demonstrate the Perl Info
|
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#101072 (status was 'open')
Searchable as RT101072$
The text was updated successfully, but these errors were encountered: