>> and I know we've discussed this before, but I really don't like the
>> idea of
>> croaking at request time - for configuration things it's ok, but the vast
>> majority of file IO and other operations in perl proper don't die: open,
>> read, most of the IO:: stuff, etc. in other words, people expect to
>> check
>> return values for these things instead of needing eval{} so we're
>> throwing
>> them a curve every time we croak instead.
>
>
> Agreed, but first, you probably also agree that most people won't check
> it
of course :)
> and usually if there is a socket problem, you can't do much, and
> there is no point to eval. Most likely you will want to die.
sure. but it's the forced die that bothers me. at least if we return undef
they can die with their own message or throw out something other than an
automatic 500.
>
> Second, let's say we don't croak and return undef. We need to set a
> consistent variable with the error message. As you saw I've failed to
> convince p5p to allow us to peruse $!. And $@ is not appropriate, we
> have no other choce but to use some other variable. So what should it
> be? $Apache::err and $Apache::errstr, ala $DBI::errstr. Or should there
> be a separate error variables for APR and Apache, since APR eventually
> could be used outside mod_perl?
$Apache::err and $APR::err sound reasonable enough - most people familiar
with mod_perl are familiar with DBI so it should be easy to adopt. it's a
shame that we can't use $!, though, since lots of the functions have the
same name as perl built-ins.
>
> Also going back to my patch, what do you think about opt_set returning
> an old value. I've coded explicitly to get that old value before setting
> the new one. That sounds Perlish, but I'm not sure whether it's worth
> the overhead.
since you're asking, I actually prefer returning the old value on set. mp1
did that for lots of things, which made typical mp-type overrides
(server_rec stuff, for example) able to eliminate an extra call to get()
my $old = $foo->set($val); # override
$foo->set($old); # restore
--Geoff
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]