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


in reply to length() and the Schwartzian transform

It seems to me that the point of the example is to show how ST works as simply as possible, NOT to show its speed or lack thereof ...
  • Comment on Re: length() and the Schwartzian transform

Replies are listed 'Best First'.
Re^2: length() and the Schwartzian transform
by hazylife (Monk) on Mar 06, 2014 at 09:33 UTC
    NOT to show its speed or lack thereof
    My main issue with that example is not that it's slow, but that it's misleading. For string scalars, Perl's length returns a value that has already been calculated (and cached) elsewhere. It's just a dumb "accessor method" for that internally stored value, which makes caching it pointless.