You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by raptor <ra...@unacs.bg> on 2001/07/12 21:39:42 UTC

Re: [aliasing] Using mod_perl handlers for max speed?

!!! Is it possible to have  reference on the left side of the equation !!!
I've tried this to alias HASH :") but didn't succeeded...
sub {
 my \$hash = shift; # $_[0] is  \%myhash
};

Yes I know that there is aliasing : my *hash = \%{$hashref}..
And I see that here u use  : \$r->blah
...Never mind it is cute construct anyway. Do U have any benefit in speed
using it in this way ?!

PS. didn't u think that there must finaly "alias" keyword in perl
=====
iVAN
raptor@unacs.bg
=====


> <Files ~ (hello\.bench)>
>     <Perl>
>        # ModPerl Handler
>          package Apache::bench;
>          sub handler {
>            my(\$r) = shift;
>            \$r->content_type('text/html');
>            \$r->send_http_header();
>            \$r->print('Hello ');
>            \$r->print('World');
>            200;
>          }
>        1;
>     </Perl>
>     SetHandler perl-script
>     PerlHandler Apache::bench
> </Files>



Re: [aliasing] Using mod_perl handlers for max speed?

Posted by Ken Williams <ke...@forum.swarthmore.edu>.
Heh - you're on the wrong track.  The whole quote below is part of a
double-quoted string, and each backslash is just to put a literal $ into
the code.  It will be eval'ed later.


raptor@unacs.bg (raptor) wrote:
>!!! Is it possible to have  reference on the left side of the equation !!!
>I've tried this to alias HASH :") but didn't succeeded...
>sub {
> my \$hash = shift; # $_[0] is  \%myhash
>};
>
>Yes I know that there is aliasing : my *hash = \%{$hashref}..
>And I see that here u use  : \$r->blah
>....Never mind it is cute construct anyway. Do U have any benefit in speed
>using it in this way ?!
>
>PS. didn't u think that there must finaly "alias" keyword in perl
>=====
>iVAN
>raptor@unacs.bg
>=====
>
>
>> <Files ~ (hello\.bench)>
>>     <Perl>
>>        # ModPerl Handler
>>          package Apache::bench;
>>          sub handler {
>>            my(\$r) = shift;
>>            \$r->content_type('text/html');
>>            \$r->send_http_header();
>>            \$r->print('Hello ');
>>            \$r->print('World');
>>            200;
>>          }
>>        1;
>>     </Perl>
>>     SetHandler perl-script
>>     PerlHandler Apache::bench
>> </Files>
>
>
>

  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum