svref_2object#

Wrap a reference’s referent as a B::* object.

Synopsis#

my $obj = B::svref_2object(\&some_sub);
my $cv  = B::svref_2object(\&main::foo);   # returns B::CV
my $av  = B::svref_2object(\@ARGV);        # returns B::AV

Given a Perl reference, return a blessed B::* object that wraps the underlying SV, AV, HV, CV, GV, etc. Croaks with argument is not a reference if the input is not a reference. This is the usual entry point into B: most introspection starts from a reference the caller already has.