Hi,
Am Dienstag, 20. Januar 2004 21:13 schrieb Stas Bekman:
> Boris Zentner wrote:
> > Hi,
[..]
> >>> Where do you install that
> >>>AUTOLOAD on functions or modules which aren't $r or $s operators?
> >>
> >>I don't want to AUTOLOAD anything that isn't called through one of
> >>those.
> >
> > This is exactly what I try to say for the last x mails. Whenever I act
> > with a object of type x, I do a 'use x;'. Here a example I can use print
> > without RequestIO but sure I must load APR::Table to use method set.
> >
> > use APR::Table;
> > use Apache::RequestRec;
> > sub handler : method {
> > my $r = shift;
> > $r->print('xx');
> > my $t = $r->notes;
> > $t->set('foo');
> > }
>
> That's not what Perrin is talking about I think. So you do suggest that a
> user need to load 'Apache::RequestRec' to get $r methods?
No and yes, I do it so because the name is now ApacheRec for your convinience.
I suggest a Apache::RequestHandle like Perrin that has all methods of
Apache::RequestRec, Apache::RequestIO and other Apache::Request*. If the
bloat seems to high to carry that all in one class, outsource with autoload
( or another aproach ) the key point is one package to load for all methods
of $x. I load Apache::RequestHandle whenever I do something with the object
that is more than store or pass through something else.
The advantage is that one can do perldoc Apache::RequestHandle or mp2doc
Apache::RequestHandle for the docs. And there is no need to remember that
method print is from Apache::RequestIO as it is now.
>
> Perrin suggests that you don't need to load anything from your code,
> because you already receive $r, so the methods should be there already.
> Compared to the situation where you create the object by yourself. So if I
> understand Perrin's vision, that code should work with:
>
> use APR::Table;
> sub handler : method {
> my $r = shift;
> $r->print('xx');
> my $t = $r->notes;
> $t->set('foo');
> }
>
> my problem is why $r is magical, but not $t. Why inconsistency? if you
> didn't create $t, you shouldn't need to load APR::Table, it should be there
> for you, just like with $r.
>
No we remove the magic namespace foo from Apache::Request* and
Apache::Server*.
> So as you can see your and Perrin's views aren't exactly the same. Please
> correct me if I'm wrong.
I think Perrin's view is exactly or very close to my view.
I'm courios about it. ;-)
>
> __________________________________________________________________
> Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org http://ticketmaster.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
Boris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]