We don't bite newbies here... much | |
PerlMonks |
Re: Fastest split possibleby Discipulus (Canon) |
on Nov 06, 2019 at 19:49 UTC ( [id://11108399]=note: print w/replies, xml ) | Need Help?? |
Hello pedrete, to see it you can use Benchmark to test different approach, like capturing using regexes with g modifier. But probably, if you are experienceing slowness with split which is fast, you simply have to avoid to accumulate results into @array Infact if $HugeString is huge, would be probably better to process each element directly like in: process($_) for split /\n/,$HugeString; L*
There are no rules, there are no thumbs.. Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
In Section
Seekers of Perl Wisdom
|
|