Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I pondered whether I prefered index() or $+[0] and I concluded $+[0]. The index() expression becomes so cluttered, and it has a problem if the substring isn't found. Then you'll destroy the beginning of the string anyway, and remove $u-1 chars from the beginning. I figured that most likely, if the marker isn't there, it's already removed. If not you still need to perform some check, and for me the regex version is nicer. I'd like to flip the coin and say "matching works find here, no need to use index()", but if one likes index() one should use index(). :-) ihb
See perltoc if you don't know which perldoc to read! In reply to Re^2: Chomping most of a _long_ text string
by ihb
|
|