From cac367cb01519969fda3a43c217dfbb009a1f358 Mon Sep 17 00:00:00 2001 From: doy Date: Fri, 1 May 2009 18:30:51 -0500 Subject: simple test script --- test.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test.pl diff --git a/test.pl b/test.pl new file mode 100644 index 0000000..ffc89a6 --- /dev/null +++ b/test.pl @@ -0,0 +1,24 @@ +#!/usr/bin/perl +use strict; +use warnings; + +use Class::Info; +my $info = Class::Info->new('NetHack::Item::Potion'); +my $methods = $info->classify_methods; +print "Local methods:\n"; +print " " . $_->as_string . "\n" for @{ $methods->{local} }; +print "Role methods:\n"; +my $role_methods = $methods->{composed}; +for my $role (keys %$role_methods) { + print " " . $_->as_string . "\n" for @{ $role_methods->{$role} }; +} +print "Inherited methods:\n"; +my $inherited_methods = $methods->{inherited}; +for my $inherit (keys %$inherited_methods) { + print " " . $_->as_string . "\n" for @{ $inherited_methods->{$inherit} }; +} +print "Imported methods:\n"; +my $imports = $methods->{imports}; +for my $import (keys %$imports) { + print " " . $_->as_string . "\n" for @{ $imports->{$import} }; +} -- cgit v1.2.3