Since you have direct access to the package via its namespace, you don't even need the package switching. This works too–
use CGI; my $cgi = CGI->new; print $cgi->foo(), "\n"; sub CGI::foo { my $self = shift; return $self->p('foo'); }
In reply to Re^3: How could we "implement" Open Classes in Perl ?
by Your Mother
in thread How could we "implement" Open Classes in Perl ?
by Alien
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |