On Tue, Jun 11, 2019 at 10:29:28AM -0400, Matthew Horsfall (alh) wrote: > Sorry, my example had one too few arguments: > > alh@hyrule:~$ perl > use overload > '""' => sub { print "STRFY($_[0][0])\n"; $_[0][0] }, > '.' => sub { print "CONCAT$_[0][0], $_[1][0])\n"; > bless [ $_[0][0] . $_[1][0] ] } > ; > > my $s = bless [ "foo" ]; > my $t = "$s $s"; > CONCATfoo, ) > CONCATfoo, foo) Yeah, but double-quotish string interpolation is well understood(*) to be just syntactic sugar for string concatenation, and indeed compiles to OP_CONCAT ops. (*) for some definition of "well". -- Music lesson: a symbiotic relationship whereby a pupil's embellishments concerning the amount of practice performed since the last lesson are rewarded with embellishments from the teacher concerning the pupil's progress over the corresponding period.Thread Previous