perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: [mp2] return value of print can break legacy apps
Date Fri, 10 Dec 2004 16:36:32 GMT
Geoffrey Young wrote:
>>>ok, try this patch.
>>ah, please hold on with patches to change API, if you change this you
>>will need to change a lot more (printf, puts, and probably read and may
>>be others too).
> I was responding to your other mail, but I'll answer here instead :)
> I don't think it's really an API change and I don't think it's as complex as
> all of that...

It certainly is an API change. At least it makes the API inconsistent 
since now:



print "";

are not the same under modperl.

Moreover, failures are not the same as perl's print. so it's really only a 
partial fix. (even though the manpage doesn't say what happens on failure, 
but we know that it returns 0).

> the perldoc for print() says it returns true on success, whereas the perldoc
> for printf(), send(), read() make no such claims.
> so, the change to print() would be to make it behave the same as perl's
> print() (which it isn't and which is different between mp1 and mp2), with
> the added benefit that it returns the numeric number of characters printed.
> anyway, all tests pass with my patch, and the only change needed was to
> request_rec.t where t_cmp does a string instead of a numerical comparison in
> the test.

I'm not against patches, I just want us to decide first what's to be done 
(if at all) and then move on with implementation, rather than the other 
way around.

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

Report problems:
Mail list info:
List etiquette:

View raw message