sub deparse_format { use B::Deparse; # translate arg (or reference to it) into a B::* object my $Bobj = B::svref_2object(ref $_[0] ? $_[0] : \$_[0]); # if passed a glob or globref, get the format $Bobj = B::GV::FORM($Bobj) if ref $Bobj eq 'B::GV'; if (ref $Bobj ne 'B::FM') { require Carp; Carp::croak "deparse_format: expected a glob, globref, or format ref"; } my $deparser = B::Deparse::->new(); return $deparser->indent($deparser->deparse_format($Bobj)); }