in reply to Re^2: Perl - Remove duplicate based on substring and check on delimiters
in thread Perl - Remove duplicate based on substring and check on delimiters
Yes, tr is the fastest and best way to do a simple count of the x's. And yes, substr is the fastest way to get a fixed length thing at the beginning. The reason that I demo'd split was to show: a)how to get a non-fixed length thing at the beginning, b)how to access some of these other length "between the x's" fields. I'm sure that they have some meaning.
Update: I almost never use the -1 limit on split. I saw an opportunity to play with this and remind myself of how it worked. Once I had done that, I impulsively posted my "play". Wasn't meant to be "earth shattering" stuff, just an example of a not so common usage that is often forgotten.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Perl - Remove duplicate based on substring and check on delimiters
by AnomalousMonk (Archbishop) on May 19, 2016 at 03:16 UTC |