... "start of string" or "end of string" markers ... should be replaced ... with lookarounds for $sep ...
But if $sep can be \n (newline), then the lookarounds become the built-in ^ $ anchors (with the /m modifier asserted, of course), which I would expect to be significantly faster than a constructed lookaround. The
my $concat = join $sep, '', @tokens, '';
statement building the target string becomes
my $concat = join $sep, @tokens;
because ^ $ always behave as expected at start/end-of-string.
Give a man a fish: <%-{-{-{-<
In reply to Re^4: Multi-thread combining the results together
by AnomalousMonk
in thread Multi-thread combining the results together
by Marshall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |