Fixed; will be in next release
--
Paul Evans
=== modified file 'lib/Devel/MAT/Dumper.pm'
--- lib/Devel/MAT/Dumper.pm 2016-06-03 18:16:14 +0000
+++ lib/Devel/MAT/Dumper.pm 2017-03-22 16:22:12 +0000
@@ -1,7 +1,7 @@
# You may distribute under the terms of either the GNU General Public License
# or the Artistic License (the same terms as Perl itself)
#
-# (C) Paul Evans, 2013-2016 -- leonerd@leonerd.org.uk
+# (C) Paul Evans, 2013-2017 -- leonerd@leonerd.org.uk
package Devel::MAT::Dumper;
@@ -82,6 +82,14 @@
$ perl -MDevel::MAT::Dumper=-file,foo.pmat ...
+In the special case that C<$0> is exactly the string C<-e> or C<-E>, the
+filename will be prefixed with C<perl> so as not to create files whose names
+begin with a leading hyphen, as this confuses some commandline parsers.
+
+ $ perl -MDevel::MAT::Dumper=-dump_at_END -E 'say "hello"'
+ hello
+ Dumping to perl-e.pmat because of END
+
If the pattern contains C<NNN>, this will be replaced by a unique serial
number per written file, starting from 0. This may be helpful in the case of
C<DIE> or C<SIGQUIT> handlers, which could be invoked multiple times.
@@ -103,7 +111,10 @@
our $MAX_STRING = 256; # used by XS code
-my $dumpfile_name = basename( $0 ) . ".pmat";
+my $basename = basename( $0 );
+$basename = "perl$basename" if $basename =~ m/^-e$/i; # RT119164
+my $dumpfile_name = "$basename.pmat";
+
my $dumpfh;
my $next_serial = 0;