in reply to Re: Re: Overriding Mail::Audit's accept()
in thread Overriding Mail::Audit's accept()

Incidentally, has anyone got any idea why Mr. Cozens would choose to make his constructor like this?

I only skimmed it, but it looks Mail::Audit::new works more as a factory (for getting either a Mail::Audit::MailInternet or Mail::Audit::MimeEntity object) then as a constructor. It seems like this would have been something that should be mentioned in the perldocs.

Speaking of the documentation, if your goal is to overide the accept method, then this section of Mail::Audit seems applicable...

new(%options) ... Other options include the accept, reject or pipe keys, which specify subroutine references to override the methods with those names.

Replies are listed 'Best First'.
Re: Re: Re: Re: Overriding Mail::Audit's accept()
by revdiablo (Prior) on Jul 01, 2003 at 06:35 UTC
    new(%options)
       ...
       Other options include the accept, reject or pipe keys,
       which specify subroutine references to override the
       methods with those names.

    I saw this in the perldocs, and made a new accept routine via this mechanism, but I could not find a clean way to get at the Mail::Audit object. I couldn't do the equivalent of $item->SUPER::accept... so I would end up having to reimplement accept from scratch, which is not something I am willing to do.

    Also, thanks all for the input. I've decided that if and until I find an acceptible mechanism for overriding accept, I will just stick to my current code, where I manually call another subroutine each time before accept (e.g. summarize($item, $folder); $item->accept($folder)).