This is for wide distribution within the organization, and I want to have as little barriers as possible to it getting used.
The installer for yours module can install the other module at the same time. That's a simple matter of putting one line in Makefile.PL.
Are you saying the easiest way to do this is to create an 'output' package and import it into both main and State::Object?
Seems simple to me:
use Logger qw( output :err_levels );
use strict; use warnings; package Logger; use Exporter qw( import ); our @EXPORT_OK = qw( LOG_ERROR LOG_VERBOSE_ERROR LOG_WARNING LOG_VERBOSE_WARNING output ); our %EXPORT_TAGS = ( err_levels => [qw( LOG_ERROR LOG_VERBOSE_ERROR LOG_WARNING LOG_VERBOSE_WARNING )], ); use constant { LOG_ERROR => 1, LOG_WARNING => 2, }; use constant { LOG_VERBOSE_ERROR => -LOG_ERROR, LOG_VERBOSE_WARNING => -LOG_WARNING, }; sub output { ... } 1;
I find it odd that control over whether the warning or error is verbose or not is in the caller's control and not a configuration item.
Update: Added code.
In reply to Re^3: Mixing procedural and OO code, one file.
by ikegami
in thread Mixing procedural and OO code, one file.
by DStaal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |