in reply to Re^2: OO Perl: Nested classes question
in thread OO Perl: Nested classes question
But use won't work properly unless you do that, so it is a good tradition to follow.
In which sense?
#!/usr/bin/perl -l use strict; use warnings; use lib sub { pop eq 'Foo.pm' && do { my $mod = join "\n", (map <<".EOM", 'A'..'Z'), "1;\n"; # -------------------- package Foo::$_; sub new { print __PACKAGE__; bless [], shift; } # -------------------- .EOM open my $fh, '<', \$mod or die $!; $fh; }; }; use Foo; Foo::J->new; Foo::A->new; Foo::P->new; Foo::H->new; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: OO Perl: Nested classes question
by tilly (Archbishop) on Sep 09, 2006 at 19:43 UTC |