Article 10198 of comp.lang.perl: Xref: feenix.metronet.com comp.lang.perl:10198 Newsgroups: comp.lang.perl Path: feenix.metronet.com!news.ecn.bgu.edu!usenet.ins.cwru.edu!eff!news.umbc.edu!europa.eng.gtefsd.com!wx.gtegsc.com!news.cerf.net!netlabs!lwall From: lwall@netlabs.com (Larry Wall) Subject: Re: Study command with s///. Message-ID: <1994Jan26.192125.1555@netlabs.com> Organization: NetLabs, Inc. References: <940122.002753.7e4.rusnews.w165w@sendai.cybrspc.mn.org> <2hs0mmINNqi3@srvr1.engin.umich.edu> <2590@alsys1.aecom.yu.edu> Date: Wed, 26 Jan 1994 19:21:25 GMT Lines: 28 In article <2590@alsys1.aecom.yu.edu> manaster@yu1.yu.edu (Chaim Manaster) writes: : Severalweeks ago I posted a question about how the s/// command effects : the study command. Unfortunately, I received no responses. : : Basically, the question is, is there any potential benefit to using the : "study" command in conjunction with a bunch of s/// commands (as opposed : to with a bunch of m// commands). Do the changes made by the s/// : invalidate totally the information obtained from the study, or does it : remain valid for the most part (depending on how extensive the : substitutions are)? A successful substitution invalidates the current study. So the more the substitutions fail, the more valuable the study is. If you've got a long list of substitutions that mostly fail, it's useful to say s/\bfoo\b/FOO/g && study; s/\bbar\b/BAR/g && study; s/\bbaz\b/BAZ/g && study; ... except for maybe the last few substitutions. But sometimes you just have to try it and see if it runs faster. There are some kinds of data on which study is useless. The letter frequency tables used by study were built by analyzing a combination of C and English. A study won't help at all if you're matching on DNA sequences. Larry