in reply to Silliness

This code seems to demonstrate a Perl bug.

I filed a bug report, but I'd be interested to see what results others get with various Perl versions.

Replies are listed 'Best First'.
Re: Re: Silliness
by converter (Priest) on May 12, 2001 at 21:47 UTC
    Reducing the test case for Perl 5.6.1:
    $_ = <<EOF; 1a 2a EOF @a = /(.*?)a/sg; print "@a\n"; # prints: # 1 @a = /([\000-\377]*?)a/g; print "@a\n"; # prints: # 1 # 2

    Update:

    Looks like this is a known bug, ID 20010410.006 on http://bugs.perl.org/

Re: Re: Silliness
by chipmunk (Parson) on May 12, 2001 at 01:11 UTC
    For the Slackware result, "jurt annther perl hacker": iamcal snuck a space onto the end of the first two lines. Without those two spaces, the s and the o get shifted up one in the alphabet, as you saw.

    I don't about the 5.6.1 result, though.

      Yes, if the spaces were missing from those two lines, this would have the same output ("jurt annther..."), but the code was not hand edited, it was copied and pasted, and produced the expected results in some cases but not in others, so I'm certain the spaces were not missing.

      Furthermore, all builds of Perl 5.6.0 that we tested printed the expected output using the same code.

      Update:
      It turns out that the right end whitespace on the first two lines assigned to $_ was truncated, evidently by a copy and paste on one of the boxes.

      I will never again allow myself to be sidetracked.
      I will never again allow myself to be sidetracked.
      I will never again allow myself to be sidetracked.
      ...