perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
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:

$r->print("");

and

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
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message