>There's no way for my aXML plugin to indicate a dependency on another plugin.
Well of the 58 currently defined plugins, only 2 have dependencies on others, and both of those refer to plugins which are part of the standard set.
Saying that I need to declare dependency on a plugin from the standard set is like saying that I need to predeclare the use of standard keywords in perl;
use use;
use my;
use foreach;
foreach my $var (@vars) ...
Its nonsense.
Now if someone had a rare problem which they cannot solve with the standard set, and they decide what is needed is to write a brand new plugin, that plugin can depend on any of the standard set without any problems.
If they then write another plugin which depends on their first new plugin, and they try to share the second plugin with people without first sharing the first plugin, they are a moron and they deserve to be confused.... j/k come on reality check!
Also it would not be that hard to code it up so that plugins have version numbers, and can check that a given required dependency has the right version.
my $plugins = {
foo => sub { our $version = '0.001';
...do some tom-foo-lery...
},
foo_bar => sub {
our $version = '0.001';
if (defined $plugins->{'foo'})
{
if ($plugins->{'foo'}->version ge '0.001')
{
... do some foo-bar stuff ...
my $var = $plugins->{'foo'}->("hello");
... do some more foo-bar stuff ...
return "result of foo-bar";
}
return 'foo_bar error; please update foo';
}
return 'foo_bar error; please install foo';
}
};
I dunno why you would want to do it that way around tho when you could just as easily pass the result of foo to foo_bar at the aXML level.
<foo_bar><foo>hello</foo></foo_bar>
|