revdiablo has asked for the wisdom of the Perl Monks concerning the following question:
Hi. I'm trying to make a class that overrides Mail::Audit's accept() method. I want to do a few simple things then call SUPER::accept(). It all seems fairly straightforward, but my overridden accept() doesn't seem to be running at all. I'm relatively inexperienced with Perl's OO inheritance, so maybe there's something I'm missing?
Here's my new class:
package Mail::Audit::Summarize; use strict; use warnings; use Mail::Audit; our @ISA = qw(Mail::Audit); 1; sub accept { # I put this in to see if my accept() is even being # called. It appears not (since this die() call is # apparently not running). die "MY ACCEPT IS RUNNING.\n"; my $self = shift; # nothing here yet. $self->SUPER::accept(@_); }
And here's how I call it:
#!/usr/bin/perl use strict; use warnings; use lib '/home/diablo/modules'; use Mail::Audit::Summarize; my $item = Mail::Audit::Summarize->new(); $item->accept();
When I run email through this filter, the mail gets properly deposited into my mail spool, but doesn't seem to use my accept() at all. Any pointers or problems found would be much appreciated.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Overriding Mail::Audit's accept()
by chromatic (Archbishop) on Jun 30, 2003 at 02:02 UTC | |
by revdiablo (Prior) on Jun 30, 2003 at 03:30 UTC | |
by hossman (Prior) on Jun 30, 2003 at 07:05 UTC | |
by revdiablo (Prior) on Jul 01, 2003 at 06:35 UTC | |
|
Re: Overriding Mail::Audit's accept()
by bobn (Chaplain) on Jun 30, 2003 at 01:58 UTC |