Sorry about that.  It was 3 AM after 12 hours beating my brains out.
I guess I didn't have any left.

Check these modules:

package simian;
use fields qw (name);

use strict; #very important!
use Apache;
use Apache::Request;
use Apache::Constants qw(:common);

sub new {
  my $type = shift;
  my simian $self = fields::new(ref $type || $type);
  $self->{name} = 'Jane';
  return $self; 
}

sub name {
  my $self = shift;

  $self->{name} = shift if @_;
  return $self->{name};         # error here, I mean
}

sub handler ($$) {
  my ($self, $q);

  my $r = Apache::Request->new($q);

  # send headers here

  print $self->name;
  return OK;
}

package macaque;
use base "simian";

sub new {
  my macaque $self = fields::new("macaque");
  return $self;
}

return 1;


then put this line in your startup.pl or a <Perl> section:

my $tree_climber = macaque->new;

Then set up the mod perl server to use this class for a handler,

<Location /macaque>
  # all the other stuff
  PerlHandler macaque
</Location>

and try to access it on the web browser.  You will get an error like 
the following:

<<<Can't use string ("Exchange::MyAccount3") as a HASH ref while "strict
refs" in use at /usr/local/lib/perl5/site_perl/MyApp/Framework3.pm line
245.>>>

This happens using "use fields" and "use base" or using @ISA
inheritance. 
What the heck am I doing wrong?

  --Christopher

Reply via email to