No, I'm running 5.20.1, at least on my pc. I took out the use 5.010 and the results are pretty much the same -- something is happening, but nothing good. Yes, study takes the time to build a table to make searching more efficient, something akin to a database index. If the strings are short, or there are only a very few searches to perform, study isn't worth the effort. I should really try it on a sample problem like the one suggested in the docs.
| [reply] [d/l] [select] |
No, the study keyword does absolutely nothing except return an appropriate boolean for backwards compatibilty. In particular, it is not building up any tables. Here is the C source code for pp_study() in 5.18.0:
PP(pp_study)
{
dVAR; dSP; dPOPss;
STRLEN len;
(void)SvPV(sv, len);
if (len == 0 || len > I32_MAX || !SvPOK(sv) || SvUTF8(sv) || SvVAL
+ID(sv)) {
/* Historically, study was skipped in these cases. */
RETPUSHNO;
}
/* Make study a no-op. It's no longer useful and its existence
complicates matters elsewhere. */
RETPUSHYES;
}
Dave. | [reply] [d/l] |
/* Pattern matching */
PP(pp_study)
{
dVAR; dSP; dPOPss;
STRLEN len;
(void)SvPV(sv, len);
if (len == 0 || len > I32_MAX || !SvPOK(sv) || SvUTF8(sv) || SvVAL
+ID(sv)) {
/* Historically, study was skipped in these cases. */
RETPUSHNO;
}
/* Make study a no-op. It's no longer useful and its existence
complicates matters elsewhere. */
RETPUSHYES;
}
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |