md_syslog (was Re: [Mimedefang] Woes following an OS upgrade)

David F. Skoll dfs at roaringpenguin.com
Tue Nov 7 15:30:24 EST 2006


Philip Prindeville wrote:

> Hmm.  syslog() already has printf-style formatting... should the wrapper
> occlude that functionality?

Yes, because it's superfluous in Perl.  Just use variable interpolation
directly.

> And what about callers that have to call sprintf directly if they want to
> handle multiple arguments?

See above.  There's never any need in Perl to use printf-style formatters.
(Well, *hardly* any.  In the unlikely case that you want something like %.10s,
you can use sprintf.)

> How likely is it that there are callers that pass "%" in the message
> string?

Any caller that has a variable as part of the second argument would have to
sanitize it.  Having the wrapper explicitly provide a "%s" template
makes it much safer and less error-prone.

--
David.



More information about the MIMEDefang mailing list