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

Re: Re: Re: Re: Weird "soundex" algorithm

by diotalevi (Canon)
on Aug 29, 2003 at 01:53 UTC ( #287567=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Weird "soundex" algorithm
in thread Weird "soundex" algorithm

Er... what overhead? You mean of making an array access because that's all it is. @+ and @- don't invoke the $`, $& and $' penalties. Those arrays are just offsets into the string. $-[0] is the offset of the beginning of the string and $+[0] is the offset of the end of the string. Using those doesn't prompt perl to do all the copying that capturing, $`, $&, and $' do. Its just not the same thing.

Granted, I did miss that scalar /g loops only once and in this usage that'd be the only loop ever used. I find myself avoiding pos() after learning that it doesn't survive a local() on the variable in question. That's just style though.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2020-11-24 06:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?