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

whither study()?

Thread Next
January 29, 2012 01:41
whither study()?
Message ID:
study() breaks stuff. It is currently subtly broken. It has been
broken for a long time. It is poorly tested. And ive never actually
seen it used in the wild.

Is it really in Perls interest that I, or anyone else with the chops,
even looks at fixing the bugs related to it? Can we just no-op and
deprecate it?

The other day I was short on time so I disabled an optimization and
pushed it as a smoke branch to see what would happen. It unexpectedly
broke stuff. When I checked what it turned out that the optimization
was hiding from us the fact that study() doesn't work properly.
Basically the tests get handled properly by the optimization, but if
you use slightly different patterns, ones we neither optimize nor
test, it turns out study() causes the regex engine to do the wrong
thing. So disabling the optimization does not actually create a bug,
it just happens to widen its scope by removing something that happens
to work around the bug in one very specific case. But all the other
similar cases are broken anyway.

So, do we really want to maintain this thing? Does anybody know how it
works? Does anybody have any examples where it actually makes a

I am going to look a /bit/ further into this just to see if it is a
quick fix waiting to happen, but i really do wonder if we should even
be maintaining this thing.


perl -Mre=debug -e "/just|another|perl|hacker/"

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