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
  • Comment on Re^2: Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.
  • Download Code

Replies are listed 'Best First'.
Re^3: Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.
by fglock (Vicar) on Dec 09, 2004 at 12:55 UTC

    Very interesting - that's because an interpolated string is actually an unnamed variable, while a simple string is just a constant.