Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Ways to delete start of string

by hsmyers (Canon)
on May 27, 2008 at 02:47 UTC ( #688607=note: print w/replies, xml ) Need Help??


in reply to Re: Ways to delete start of string
in thread Ways to delete start of string

The results of this formulation are:
Rate substr_lval subst reverse substr_mod s +ubstr_copy substr_lval 489949/s -- -9% -37% -67% + -69% subst 539218/s 10% -- -31% -63% + -66% reverse 776376/s 58% 44% -- -47% + -52% substr_mod 1473954/s 201% 173% 90% -- + -8% substr_copy 1606272/s 228% 198% 107% 9% + --
Not hard to see the problem with $_. That said I'm not sure that what you say about how things shouldn't be in a sub is correct. Shouldn't it factor out since it would be true for all cases?

--hsm

"Never try to teach a pig to sing...it wastes your time and it annoys the pig."

Replies are listed 'Best First'.
Re^3: Ways to delete start of string
by ikegami (Pope) on May 27, 2008 at 02:54 UTC

    Shouldn't it factor out since it would be true for all cases?

    No. (a+k)/(b+k) is not equal to a/b. And it diminishes the value of the absolute numbers.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://688607]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2019-12-09 18:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?