http://www.perlmonks.org?node_id=413453


in reply to Re: Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.
in thread Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.

Doh !
Thanks to fglock and Errto for pointing out the obivous.
This at least "fixes" my $var3:
my ($var3) = map { s/\r?\n\Z/(munched)/; $_ } <<EOT; Var also has an interpolated var: $interpolated And the last newline is also absent -> EOT
However, $var4 still explodes on a read-only value, and I still haven't found, apart from eval'ing the whole thing, how to do the same for $href->{key3} = {...

--
Olivier