------=_Part_29036_11688193.1202663675158
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Nice, Thanks!

Just figured this out...



A known disadvantage to Perl method calls is that they are slower than
direct function calls. It is possible to resolve method calls at
compile time, rather than runtime, making method calls just as fast as
subroutine calls. However, there is certain information required for
method look ups that are only known at runtime. To work around this,
compile-time hints can be used, for example:
my Apache2::Request $r = shift;
Tells the Perl compiler to expect an object in the C
class to be assigned to C<$r>. A patch has already been submitted to
use this information so method calls can be resolved at compile time.
However, the implementation does not take into account sub-classing of
the typed object. Since the mod_perl API consists mainly of methods,
it would be advantageous to re-visit the patch to find an acceptable
solution.




On Feb 10, 2008 12:06 PM, Perrin Harkins wrote:

> On Feb 10, 2008 1:57 AM, Mag Gam wrote:
> > doc.pl looks like this:
> > #!/usr/bin/perl -w
> > use strict;
> > use CGI;
> > use APR::Request::Apache2 ();
> >
> >
> > print "Content-type: text/html\n\n";
> > print "Hello";

>
> my $r = shift;
>
> > my $req = Apache2::Request->new($r, POST_MAX => "1M");

>
> Also, don't print your Content-type header. Use CGI or $r to do it.
>
> - Perrin
>


------=_Part_29036_11688193.1202663675158
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Nice, Thanks!

 

Just figured this out...


 

 

A known disadvantage to Perl method calls is that they are slower than
direct function calls.  It is possible to resolve method calls at
compile time, rather than runtime, making method calls just as fast as

subroutine calls.  However, there is certain information required for
method look ups that are only known at runtime.  To work around this,
compile-time hints can be used, for example:

 my Apache2::Request $r = shift;

Tells the Perl compiler to expect an object in the C<Apache2::Request>
class to be assigned to C<$r>.  A patch has already been submitted to
use this information so method calls can be resolved at compile time.

However, the implementation does not take into account sub-classing of
the typed object.  Since the mod_perl API consists mainly of methods,
it would be advantageous to re-visit the patch to find an acceptable
solution.


 

 


 

On Feb 10, 2008 12:06 PM, Perrin Harkins <errin@elem.com">perrin@elem.com> wrote:


On Feb 10, 2008 1:57 AM, Mag Gam <magawake@gmail.com> wrote:
> doc.pl looks like this:
> #!/usr/bin/perl -w
>  use strict;
> use CGI;

> use APR::Request::Apache2 ();
>
>
> print "Content-type: text/html\n\n";
> print "Hello";

my $r = shift;


> my $req = Apache2::Request->new($r, POST_MAX => "1M");

Also, don't print your Content-type header.  Use CGI or $r to do it.

- Perrin




------=_Part_29036_11688193.1202663675158--