1Devel::InnerPackage(3pm)Perl Programmers Reference GuideDevel::InnerPackage(3pm)
2
3
4
6 Devel::InnerPackage - find all the inner packages of a package
7
9 use Foo::Bar;
10 use Devel::InnerPackage qw(list_packages);
11
12 my @inner_packages = list_packages('Foo::Bar');
13
15 Given a file like this
16
17 package Foo::Bar;
18
19 sub foo {}
20
21
22 package Foo::Bar::Quux;
23
24 sub quux {}
25
26 package Foo::Bar::Quirka;
27
28 sub quirka {}
29
30 1;
31
32 then
33
34 list_packages('Foo::Bar');
35
36 will return
37
38 Foo::Bar::Quux
39 Foo::Bar::Quirka
40
42 list_packages <package name>
43 Return a list of all inner packages of that package.
44
46 Simon Wistow <simon@thegestalt.org>
47
49 Copyright, 2005 Simon Wistow
50
51 Distributed under the same terms as Perl itself.
52
54 None known.
55
56
57
58perl v5.12.4 2011-06-01 Devel::InnerPackage(3pm)