diff --git a/lib/Devel/IPerl/Plugin/PDLGraphicsGnuplot.pm b/lib/Devel/IPerl/Plugin/PDLGraphicsGnuplot.pm index 2734c00..3d8969a 100644 --- a/lib/Devel/IPerl/Plugin/PDLGraphicsGnuplot.pm +++ b/lib/Devel/IPerl/Plugin/PDLGraphicsGnuplot.pm @@ -41,6 +41,11 @@ around new => sub { # C is called. capture_stderr(sub { # capture to avoid printing out the dumping warning + local $SIG{__WARN__} = sub { + warn $_[0] unless $_[0] =~ m{ + WARNING\s+-\s+dumping\s+ON + }xs; + }; $gpwin->option( dump => 1 ); }); } @@ -57,6 +62,11 @@ around _printGnuplotPipe => sub { #local *STDERR; open STDOUT, '>', \$dump_stdout or die "Can't open STDOUT: $!"; #open STDERR, '>', \$dump_stderr or die "Can't open STDERR $!"; + local $SIG{__WARN__} = sub { + warn $_[0] unless $_[0] =~ m{ + \(killed\s+gnuplot\) + }xs; + }; return $orig->(@_); } else { return $orig->(@_); @@ -66,9 +76,15 @@ around _printGnuplotPipe => sub { sub iperl_data_representations { my ($gpwin) = @_; return unless $Devel::IPerl::Plugin::PDLGraphicsGnuplot::IPerl_compat; + return unless $gpwin->{replottable}; capture_stderr(sub { # capture to avoid printing out the dumping warning - $gpwin->option( dump => 0); + local $SIG{__WARN__} = sub { + warn $_[0] unless $_[0] =~ m{ + WARNING\s+-\s+dumping\s+OFF + }xs; + }; + $gpwin->option( dump => 0 ); }); my $format = $Devel::IPerl::Plugin::PDLGraphicsGnuplot::IPerl_format; @@ -88,6 +104,11 @@ sub iperl_data_representations { capture_stderr( sub { # capture to avoid printing out the dumping warning + local $SIG{__WARN__} = sub { + warn $_[0] unless $_[0] =~ m{ + WARNING\s+-\s+dumping\s+OFF + }xs; + }; $gpwin->option( dump => 0 ); } );