| B-More documentation | Contained in the B-More distribution. |
B::More - Additional introspection methods and functions
Adds stuff I needed in B and wasn't there :-)
Feel free to email me with suggestions for other methods I can add.
Inverse of B::svref_2object.
Returns a string containing the types of all MAGIC.
Returns the B::MAGIC object for the magic with specified type, or undef if no magic with that type was found.
Returns the default stash (main::) as B::HV object.
Returns the current stash (package) as B::HV object. Note that this only makes sense at compile time (in a BEGIN-block or in eval-string).
B, perlguts
Matthijs van Duin <xmath@cpan.org>
Copyright (C) 2003 Matthijs van Duin. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| B-More documentation | Contained in the B-More distribution. |
# $Id: More.pm,v 1.4 2003/02/20 00:03:33 xmath Exp $ package B::More; use 5.006; use strict; use warnings; our $VERSION = "1.01"; use Carp; use B; require XSLoader; XSLoader::load('B::More', $VERSION); sub B::PVMG::magic : method { my $x = shift->MAGIC; my $type = shift; croak "Too many arguments for 'magic'" if @_; if (not defined $type) { for (; $x && $$x; $x = $x->MOREMAGIC) { $type .= $x->TYPE; } return $type; } for (; $x && $$x; $x = $x->MOREMAGIC) { return $x if $x->TYPE eq $type; } return; } 1; __END__