FAQ

[jmahood - Wed May 07 08:18:05 2003]:

Under 5.8.0, it seems that any loop (for, while, do while) that
contains a
label and a goto causes a segmentation fault when the loop's end
condition is
met.

for ($x=0; $x < 5; $x++) {
goto FOO;
FOO:
print "$x\n";
}

....results in:


1
2
3
4
Segmentation fault

.... whereas inserting "last if ($x == 4);" at the end of the loop
breaks it
without the seg fault.
I did not get the segmentation fault when testing with Perl 5.8.4, so
I'm guessing this bug was fixed somewhere between 5.8.1 and 5.8.4.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedApr 23, '05 at 1:00p
activeApr 23, '05 at 1:00p
posts1
users1
websiteperl.org

1 user in discussion

Steve Peters via RT: 1 post

People

Translate

site design / logo © 2022 Grokbase