Subject: bug#33183: perl-mode: indent-region injects spaces after newlines causing data loss

From: 積丹尼 Dan Jacobson <[email-masked]>
Date: Sun, 28 Oct 2018 08:56:47 +0800

In perl-mode

%fields = (
    u =>
    'test
ing' . q{test
2} .
    qq/last
test/ );

becomes

%fields = (
    u =>
    'test
    ing' . q{test
    2} .
    qq/last
    test/ );

after running indent-region, on the region. However

my $x= 'new
    line';
my $y= q{new
    line};

is unaffected, thankfully.
emacs-version "25.2.2"

Also wrecks
     u =>
    <<EOF
nnnn
xxxx
EOF

P.S., takes a lot of work to repair wrecked areas. One form of data loss!

In fact it even wrecks top level here-docs:
my $x = <<EOF;
nnnn
xxxx
EOF

will get wrecked.

Also wrecks
sub mq{
    return "a
b";}