perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject [mp2] last call for $filter->read
Date Wed, 02 Jun 2004 03:23:50 GMT
I think this is the last function in the read() family that needs tweaking 
(currently most errors are silently ignored). I've changed the API to be 
consistent with the rest of modperl 2.0 read functions, and the only added 
inconvenience is that you need to add defined inside while call. So instead of 

     while ($filter->read(my $buffer, $wanted)) {

You will write:

     while (defined(my $buffer = $filter->read($wanted))) {

The existing API is badly broken, since there is no way to break the while 
loop in case of an error. It was working perfectly when there are no errors.

Errors are now checked internally and exceptions are thrown if anything goes 

I've adjusted all the tests and they all pass fine. Let me know if you have 
any problem with that change.

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message