Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

bart (450)

Journal of bart (450)

Sunday November 26, 2006
01:54 PM

Ad Hoc parsing

[ #31721 ]
In his POD for Text::Sprintf::Named, Shlomi Fish writes:

The (possibly ad-hoc) regex for matching the optional digits+symbols parameters' prefix of the sprintf conversion was originally written by Bart Lateur (BARTL on CPAN) for his String::Sprintf module.

I could have provided a very strict check for the formatting data, but it wouldn't have been very useful. At the time the formatter is built, the formatting string is not yet passed to it. That happens when you actually try to use it as a formatting template.

So I chose to let the actual semantic checks on whether this field contains nonsense or not, depend on the callback, or, usually, to the native sprintf if that is what it's built upon. As this happens at roughly the same time as the original check would have run, that'll do just as well, and it'll be faster, anyway.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.