On Tue, Mar 14, 2000 at 04:22:55PM -0000, [EMAIL PROTECTED] wrote:
> Uses a 5.005 or better feature. There's no "require 5.005" in Makefile.PL
> and no mention of a version requirement in README or INSTALL.
>
> Sequence (?<...) not recognized at blib/lib/Ima/DBI.pm line 419.
Damn! Forgot that positive lookbehinds where 5.005 only. I don't
want to keep Ima::DBI usable with 5.004_04 at least, and since this
lookbehind is only for a debugging assert I don't think its worth the
trouble.
I don't suppose anyone can think of a 5.004 way to write this:
# Make sure we got something that looks like a
# sprintf() string.
assert( do { my $count = 0;
$count = () = $statement =~ m/(?<!%)%[^%]/g;
$count == @_ } ) if DEBUG;
I'm verifying that I got enough arguments to fill each part of the
sprintf string. The regex counts placeholders and makes sure we have
an argument for each.
Of course, considering that sprintf() will happily take any number of
arguments without so much as a peep, and its entirely possible you
just want to leave the whole thing blank, the assert() might be
unecessary.
Will ponder, thanks for the catch.
--
Michael G Schwern http://www.pobox.com/~schwern/ [EMAIL PROTECTED]
Sometimes these hairstyles are exaggerated beyond the laws of physics
- Unknown narrator speaking about Anime