develooper Front page | perl.perl5.porters | Postings from May 2012

Reasons not to include vt in \s

Thread Next
Father Chrysostomos
May 27, 2012 23:05
Reasons not to include vt in \s
Message ID:
I did not speak sooner, because, when this was first brought up, I did not realise the implications.

Including vt in \s without a pragma is an incompatible change.  \s has long been documented not to include vt, so many people may be relying on that.  Worse, any breakage it causes is likely to be so subtle that no-one notices until it is too late.

Including it in a pragma is the only way.

Putting it in is not a good idea.  All the features that ‘use v5.16.0’ enables are (1) new features or (2) fixes to unfixable bugs.  In both cases, what provides is an improvement.  In the case of vt, I’m not so sure that is so.

Adding vt to \s might make Perl’s whitespace definition more conformant with other languages, but it also makes it *less* conformant with, say, PDF and HTML.  So we are not becoming more conformant, but just shifting things around.

For practical purposes, one can add \ck to \s by writing [\ck\s].  It’s much harder to subtract it.  Soon, the recommendation will be ‘use v5.18.0’ for parsing JavaScript, but ‘use v5.18.0; no feature "vt""’ for parsing HTML or PDF.

I don’t think the change is worth the resulting confusion.

If it is going to go anywhere, it should be in a separate pragma.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About