[EMAIL PROTECTED] (Vasily Petrushin) wrote:
>On Tue, 30 Jan 2001, Ken Williams wrote:
>>    sub handler ($$) {
>>      my ($self, $q);
>> 
>>  ->  $self = $self->new(); ??? 8-[   ] who is $self->new() ???
>
>       $self = PackageName->new();

This is a Perl question and not a mod_perl question, so I don't want to
get into a big discussion here, but I meant what I wrote.  Try running
the following program to see what I mean:


      ==============================
      package Fooey;

      sub method {
        my $self = shift;
 ->     $self = $self->new;
      }

      sub new {
        my $class = shift;
        return bless {}, $class;
      }


      package main;

      $class = 'Fooey';
 ->   $object = $class->method;

      print "\$object is an object, see: $object\n";
      ==============================

The lines with the arrows demonstrate the technique you didn't think
would work.


  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  [EMAIL PROTECTED]                            The Math Forum

Reply via email to