7 use B::Asmdata qw(@specialsv_name);
8 use B::Concise qw(concise_cv set_style_standard);
12 my ($order, $cvref) = @_;
13 set_style_standard("terse");
14 if ($order eq "exec") {
15 concise_cv('exec', $cvref);
17 concise_cv('basic', $cvref);
24 my $order = @args ? shift(@args) : "";
25 $order = "-exec" if $order eq "exec";
26 unshift @args, $order if $order ne "";
27 B::Concise::compile("-terse", @args);
31 my $level = @_ ? shift : 0;
35 # Don't use this, at least on OPs in subroutines: it has no way of
36 # getting to the pad, and will give wrong answers or crash.
38 carp "B::OP::terse is deprecated; use B::Concise instead";
39 B::Concise::b_terse(@_);
43 my($sv, $level) = (@_, 0);
45 B::Concise::concise_sv($sv, \%info);
46 my $s = B::Concise::fmt_line(\%info, "#svclass~(?((#svaddr))?)~#svval", 0);
47 print indent($level), $s, "\n";
51 my ($sv, $level) = @_;
53 printf "%s (0x%lx)\n", class($sv), $$sv;
56 sub B::SPECIAL::terse {
57 my ($sv, $level) = @_;
59 printf "%s #%d %s\n", class($sv), $$sv, $specialsv_name[$$sv];
68 B::Terse - Walk Perl syntax tree, printing terse info about ops
72 perl -MO=Terse[,OPTIONS] foo.pl
76 This version of B::Terse is really just a wrapper that calls B::Concise
77 with the B<-terse> option. It is provided for compatibility with old scripts
78 (and habits) but using B::Concise directly is now recommended instead.
80 For compatiblilty with the old B::Terse, this module also adds a
81 method named C<terse> to B::OP and B::SV objects. The B::SV method is
82 largely compatible with the old one, though authors of new software
83 might be advised to choose a more user-friendly output format. The
84 B::OP C<terse> method, however, doesn't work well. Since B::Terse was
85 first written, much more information in OPs has migrated to the
86 scratchpad datastructure, but the C<terse> interface doesn't have any
87 way of getting to the correct pad. As a kludge, the new version will
88 always use the pad for the main program, but for OPs in subroutines
89 this will give the wrong answer or crash.
93 The original version of B::Terse was written by Malcolm Beattie,
94 E<lt>mbeattie@sable.ox.ac.ukE<gt>. This wrapper was written by Stephen
95 McCamant, E<lt>smcc@MIT.EDUE<gt>.