> =head1 ABSTRACT
> 
> There needs to be a way for an object class to define C<printf> format
> specifiers for use in formatting objects into strings with C<printf> and
> C<sprintf>.

I find myself agreeing with your sentiment, but the approach in this RFC
is not sufficiently general.  Why only provide hooks for printf, not for
formats and output disciplines?

I think a better approach would be that the to-string operator for
objects should get an optional 'width' parameter.  In normal cases
(stringification, interpolation), that argument would not be set.  In
printf and formats, but maybe also by specific file disciplines (e.g.
the 72-character-wide output file), the width parameter would be set and
indicate how wide the object may print its data.

Hildo

Reply via email to