> - use better API naming s/warn/warn_type/. it's not clear what 'warn' is.

I still don't like the use of raw numbers 1, 2 for
Apache::TestConfig::genwarning. We try to make the code self-documenting,
so let's do that.

May I add:

  use constant WARN_STYLE_NONE => 0;
  use constant WARN_STYLE_PERL => 1;
  use constant WARN_STYLE_C    => 2;

or if you don't mind, adding a dependency on CPAN's enum.pm, which we may
find useful in more places:

  use enum qw(WARN_STYLE_NONE WARN_STYLE_PERL WARN_STYLE_C);

and then in the code write:

genfile($file, WARN_STYLE_PERL);

or outside of Apache::TestConfig:

genfile($file, Apache::TestConfig::WARN_STYLE_PERL);

Since we may find useful the context of NONE, PERL, C in other cases, we
may as well define:

  use constant NONE => 0;
  use constant PERL => 1;
  use constant C    => 2;

in Apache::Test

and then reuse it everywhere, like so:

genfile($file, Apache::Test::PERL);

writefile($file, $content, Apache::Test::NONE);

hmm, this probably makes the code less clear.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to