perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: [mp2] one more pass on mp2/apr read() functions
Date Wed, 09 Jun 2004 20:05:25 GMT
Stas Bekman <stas@stason.org> writes:

[...]

> >>I'm also going to add a wrapper to replace the crafty
> >>
> >>  if (ref $@ eq 'Apache::Error' && $@ == APR::TIMEUP) { ... }
> >>
> >>with:
> >>
> >>  if (APR::Error::foo($@, APR::TIMEUP)) { ... }

OTOH, why not just write

  if ($@ == APR::TIMEUP) { ... }

? If you're worried about numerification warnings
(assuming $@ isn't a number or an APR::Error object), 
making APR::TIMEUP an APR::Error object would cause 
perl to call the overloaded "==".

-- 
Joe Schaefer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message