$ PERL5DB='sub DB::DB{} die' perl5.18.1 -dle 'print "ok"'
Died.
$ PERL5DB='sub DB::DB{}
die' perl5.18.1 -dle 'print "ok"'
ok
So everything after the line break is ignored.
In bleadperl:
$ PERL5DB='sub DB::DB{} die' ./perl -dle 'print "ok"'
Died.
$ PERL5DB='sub DB::DB{}
die' ./perl -dle 'print "ok"'
Died at -e line 1.
Now the whole environment variable is used. This was probably changed
by commit 2179133.
Let’s call it a bug fix and test it.
(The ‘at -e line 1’ is not right, but the next commit will fix it.)
# This test depends on t/lib/Devel/switchd*.pm.
-plan(tests => 11);
+plan(tests => 12);
my $r;
# miniperl tacks a BEGIN block on to the same line
'Copy on write does not mangle ${"_<-e"}[0] [perl #118627]',
);
+
+# PERL5DB with embedded newlines
+{
+ local $ENV{PERL5DB} = "sub DB::DB{}\ndie";
+ like(
+ runperl(
+ switches => [ '-Ilib', '-ld' ],
+ prog => 'print qq|not ok|',
+ stderr => 1
+ ),
+ qr /Died/,
+ 'PERL5DB with embedded newlines',
+ );
+}