Algorithm-ToNumberMunger
view release on metacpan or search on metacpan
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
lib/Algorithm/ToNumberMunger.pm view on Meta::CPAN
C<A>/C<AAAA> is normal.
=head2 syslog_severity_enum
{ munger => 'syslog_severity_enum' }
Named-map enum (lookup rules as L</dns_rcode_enum>; numeric inputs pass
through) mapping syslog severity names to their RFC 5424 codes: C<emerg> 0
(alias C<panic>), C<alert> 1, C<crit> 2, C<err> 3 (alias C<error>),
C<warning> 4 (alias C<warn>), C<notice> 5, C<info> 6 (alias
C<informational>), C<debug> 7. Genuinely ordinal -- lower is more severe --
so a threshold split on it is meaningful.
=head2 syslog_facility_enum
{ munger => 'syslog_facility_enum' }
Named-map enum (lookup rules as L</dns_rcode_enum>; numeric inputs pass
through) mapping syslog facility names to their RFC 5424 codes: C<kern> 0,
C<user> 1, C<mail> 2, C<daemon> 3, C<auth> 4 (alias C<security>), C<syslog> 5,
C<lpr> 6, C<news> 7, C<uucp> 8, C<cron> 9, C<authpriv> 10, C<ftp> 11, C<ntp>
lib/Algorithm/ToNumberMunger.pm view on Meta::CPAN
panic => 0,
alert => 1,
crit => 2,
err => 3,
error => 3,
warning => 4,
warn => 4,
notice => 5,
info => 6,
informational => 6,
debug => 7,
},
},
syslog_facility => {
numeric => 1,
map => {
kern => 0,
user => 1,
mail => 2,
daemon => 3,
auth => 4,
t/mungers.t view on Meta::CPAN
is( $qtype->('ANY'), 255, 'dns_qtype_enum maps ANY' );
is( $qtype->('*'), 255, 'dns_qtype_enum maps * as ANY' );
is( $qtype->('HTTPS'), 65, 'dns_qtype_enum maps HTTPS' );
is( $qtype->(28), 28, 'dns_qtype_enum passes numeric input through' );
my $sev = $M->build( { munger => 'syslog_severity_enum' } );
is( $sev->('emerg'), 0, 'syslog_severity_enum emerg' );
is( $sev->('panic'), 0, 'syslog_severity_enum panic alias' );
is( $sev->('ERROR'), 3, 'syslog_severity_enum error alias, case-insensitive' );
is( $sev->('warn'), 4, 'syslog_severity_enum warn alias' );
is( $sev->('debug'), 7, 'syslog_severity_enum debug' );
is( $sev->(6), 6, 'syslog_severity_enum passes numeric input through' );
my $fac = $M->build( { munger => 'syslog_facility_enum' } );
is( $fac->('kern'), 0, 'syslog_facility_enum kern' );
is( $fac->('security'), 4, 'syslog_facility_enum security alias for auth' );
is( $fac->('authpriv'), 10, 'syslog_facility_enum authpriv' );
is( $fac->('local0'), 16, 'syslog_facility_enum local0' );
is( $fac->('LOCAL7'), 23, 'syslog_facility_enum local7, case-insensitive' );
my $proto = $M->build( { munger => 'ip_proto_enum' } );
( run in 0.334 second using v1.01-cache-2.11-cpan-bbcb1afb8fc )