lilphil has asked for the wisdom of the Perl Monks concerning the following question:
#### test.pl #!/usr/bin/perl -w use strict; use plugins; my $P = new plugins(); $P->loadplugins(); sub registerplugin { $P->registerplugin(@_); } #### end #### plugins.pm package plugins; use wrap; sub new { my $class = shift; my $self = {}; bless($self, $class); return $self; } sub loadplugins { my $self=shift; wrap::requirer('foo.pl'); } sub registerplugin { my $self = shift; my $arg = shift; print $arg; } 1; #### end #### wrap.pm package wrap; sub requirer { require 'foo.pl'; } sub registerplugin { main::registerplugin(@_); } 1; #### end #### foo.pl registerplugin("hi"); #### end
janitored by ybiC: Balanced <readmore> tags around long code block
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: quarantining required files
by gmpassos (Priest) on Jan 24, 2004 at 20:05 UTC | |
by lilphil (Scribe) on Jan 24, 2004 at 23:32 UTC | |
|
Re: quarantining required files
by Anonymous Monk on Jan 24, 2004 at 19:40 UTC | |
|
Re: quarantining required files
by theguvnor (Chaplain) on Jan 25, 2004 at 15:04 UTC | |
by lilphil (Scribe) on Jan 25, 2004 at 17:41 UTC |