summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/B/O.pm15
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/B/O.pm b/ext/B/O.pm
index 89352fb6e7..455a061325 100644
--- a/ext/B/O.pm
+++ b/ext/B/O.pm
@@ -4,13 +4,16 @@ use Carp;
sub import {
my ($class, @options) = @_;
- my $quiet = 0;
- if ($options[0] eq '-q') {
+ my ($quiet, $veryquiet) = (0, 0);
+ if ($options[0] eq '-q' || $options[0] eq '-qq') {
$quiet = 1;
- shift @options;
open (SAVEOUT, ">&STDOUT");
close STDOUT;
open (STDOUT, ">", \$O::BEGIN_output);
+ if ($options[0] eq '-qq') {
+ $veryquiet = 1;
+ }
+ shift @options;
}
my $backend = shift (@options);
eval q[
@@ -37,6 +40,8 @@ sub import {
}
&$compilesub();
+
+ close STDERR if $veryquiet;
}
];
die $@ if $@;
@@ -67,6 +72,10 @@ produce output themselves (C<Deparse>, C<Concise> etc), so that
their output is not confused with that generated by the code
being compiled.
+The C<-qq> option behaves like C<-q>, except that it also closes
+STDERR after deparsing has finished. This suppresses the "Syntax OK"
+message normally produced by perl.
+
=head1 CONVENTIONS
Most compiler backends use the following conventions: OPTIONS