develooper Front page | perl.perl5.porters | Postings from June 2019

Re: Making join() respect string-concat operator

Thread Previous | Thread Next
June 10, 2019 14:22
Re: Making join() respect string-concat operator
Message ID:
On Wed, Jun 5, 2019 at 5:30 AM Dave Mitchell <> wrote:
> At the moment its reasonably clear that where you explicitly use the '.'
> operator (and double-quoted strings, which are syntactic sugar for
> concatenation) you should expect concat overloading to be honoured.
> We should keep a clear distinction between:
>     concat operator '.' appears in the source code
> and
>     perl concatenates two strings for some reason.

To me "" seems like the latter, not the former.

This is probably documented somewhere but I find it surprising that
"$foo" calls concat overloading on $foo before string overloading.

Anyway... my concern with changing this is the performance
implications Dave mentioned, and also what problems this change in
behaviour might introduce to existing code. We can test CPAN for that
but not DARKPAN.

-- Matthew Horsfall (alh)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About