Perl 5.10: December 2007 Archives
The new say function isn't supported by the perl.vim file that ships with vim. Nick Hibma, the maintainer, tells me it will be updated in the next version of vim. In the meantime, you can hack your local vim files by adding the following line to your ~/.vim/syntax/perl.vim file:
syn keyword perlStatementFiledesc \ binmode close closedir eof fileno getc \ lstat print printf readdir readline readpipe rewinddir \ say select stat tell telldir write \ nextgroup=perlFiledescStatementNocomma skipwhite
Even if you haven't upgraded to Perl 5.10, you can use Jim Keenan's Perl6::Say module to add the say function.
My baby, ack, broke under Perl 5.10.0, because of a fix in regex behavior that I had been using unknowingly. See, I had always used my regex objects like this:
my $re = qr/^blah blah/; if ( $string =~ /$re/sm )...
when I should have been using it like this:
my $re = qr/^blah blah/sm; if ( $string =~ /$re/ )...
The bug in 5.8.x is that the /$re/sm would incorrectly apply the /sm modifiers to $re. This made the code happen to work, but for the wrong reason. What was especially tricky about finding my bug was that in 5.10.0, the call to /$re/sm ignores the /sm, but doesn't tell you that.
After some back and forth on p5p, a patch was submitted that gave the warning about the ignored /sm flags, but alas, Perl 5.10 was already out. It wouldn't have been so bad if it hadn't been the day AFTER it was released.
So, lesson learned: Test your code against new release candidates of Perl, both for your code's sake, AND for Perl's sake.
And y'know, now that I think of it, this is probably a great policy for Perl::Critic just waiting to happen. I wonder how many other people are doing their regexes the wrong way, too.