Show quoted text> Speaking of documentation and the export list, I seem to have to "use
> Sys::Syslog qw(:DEFAULT :macros);" in order to get things to compile
> under "use strict". Is that intentional? From reading the
> documentation, I got the impression I should be ale to simply say "use
> Sys::Syslog;" to import everything I need for normal use of the
> package.
That's intentional because Sys::Syslog didn't export the LOG_* macros
before version 0.11. As these "macros" really are Perl functions,
exporting them cost memory. Therefore they are not exported by default,
in order to stay consistent with older versions. Also, using these
macros is not needed in most cases as the openlog() and syslog()
functions both accept strings and numeric macros. setlogmask() is the
only function that only accepts numeric macros.
Therefore if you want to write a program that uses the numeric macros
in a sane way, you'll indeed need to
use Sys::Syslog qw(:standard :macros);
and probably add a dependency on version 0.11 of Sys::Syslog.
To be perfectly complete, it was previously possible to use the macros,
but only by fully naming them, hence leading to this horrible syntax:
setlogmask( Sys::Syslog::LOG_UPTO(SYS::Syslog::LOG_DEBUG) );
That's probably the reason why so few modules on the CPAN use
setlogmask().
Sébastien Aperghis-Tramoni
-- - --- -- - -- - --- -- - --- -- - --[
http://maddingue.org ]
Close the world, txEn eht nepO