http://www.perlmonks.org?node_id=134501


in reply to Re: Why study SCALAR?
in thread Why study SCALAR?

study is meant to be used on the target string, not the regular expression!
study($line); $line =~ /$TEXT/;
Of course, study won't be a win if you're only going to perform a single match on the target string. And it turns out that it probably won't be a win even if you do a bunch of matches on the target string. The regular expression engine has had lots of optimizations added to it over time, making it pretty fast with or without the use of study.