diff options
author | Robin Houston <robin@cpan.org> | 2001-05-09 20:17:50 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-09 23:03:52 +0000 |
commit | 485988ae91f33f9ab57f23ebd01197ce6b6aa55f (patch) | |
tree | 8d4ce40cf611f557f539bc5eb1b172cb30e20eb2 /ext | |
parent | 4135c0a0e71788fb84c0608a84dab7d6d320b6e8 (diff) | |
download | perl-485988ae91f33f9ab57f23ebd01197ce6b6aa55f.tar.gz |
B::Deparse tester
Message-ID: <20010509191750.A16940@penderel>
p4raw-id: //depot/perl@10059
Diffstat (limited to 'ext')
-rw-r--r-- | ext/B/O.pm | 15 |
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 |