I have a CGI::Application::Plugin that requires MyCgiApp to use another plugin.
Let's say CGI::Application::Plugin::Scotch makes use of CGI::Application::Plugin::Session.
How do I make it so MyCgiApp does not need to 'use CGI::Application::Plugin::Session;' ?
That is..
package MyCgiApp; use base 'CGI::Application'; use CGI::Application::Plugin::Scotch; # at this point, MyCgiApp should behave as if # CGI::Application::Plugin::Session was imported into the # package.
I can get similar behavior by importing CGI::Application::Plugin::Session into CGI::Application::Plugin::Scotch, and then exporting the methods I want out to the cgiapp.
But this seems messy. The only 'clean' solution seems to be..package CGI::Application::Plugin::Scotch; use CGI::Application::Plugin::Session; use Exporter ... @EXPORT = qw/scotch session/;
package MyCgiApp; use base 'CGI::Application'; use CGI::Application::Plugin::Scotch; use CGI::Application::Plugin::Session;
Should I stick with that (seems clunky)- or is there some other way to get package x to import package y if you use package z?
In reply to get package x to import package y if you use package z by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |