[Mimedefang] Using MD variables from a .pl file

Oliver Schulze L. oliver at samera.com.py
Thu Apr 26 09:13:39 EDT 2007


Hi Jan-Pieter,
I'm having another issue, that is when calling the function:
my $dir_tmp = main::get_quarantine_dir();
I do not get the quaratine dir.

The extrange part is that this problem I get in Centos 4.4 but it
works in Centos 4.0.
So clearly its Centos 4.4 fault.

My Filter/Class looks like this:
---------------------
#myfile.pl
package myclass;

sub new {
    my $class = shift;
    my $self  = {};

    bless ($self, $class);
    return $self;
}

sub test1() {
    my $selft = shift;
    $self->test2();
}
sub test2() {
    my $selft = shift;
    my $dir_tmp = main::get_quarantine_dir();
    md_syslog('info', "dir: $dir_tmp");
}

1;
---------------------

In filter_end() from mimedefang-filter I do:
---------------------
require myfile.pl;

my $test3 = new myclass();
$test3->test1();
---------------------
and the variable $dir_tmp is empty in Centos 4.4 and it works in Centos 4.0

Do I have some syntax or perl concept error?

Many thanks
Oliver


Jan-Pieter Cornet wrote:
> On Wed, Apr 18, 2007 at 04:15:12AM -0400, Oliver Schulze L. wrote:
>   
>> I'm doing some development with MD have created an object or calls.
>> I then call :
>> require "myfile.pl";
>>
>> from filter_end() in mimedefang-filter. The problem I'm getting is that
>> I could not use/see MD variables like $Sender.
>>
>> I'm don't if it is ok what I'm doing. Any tips are welcome.
>>
>> Example core:
>> -----------
>> #myfile.pl
>> package myclass;
>>
>> sub test1() {
>>  print "$Sender\n";
>> }
>>
>> 1;
>> -------
>> The error in maillog is:
>> Global symbol "$Sender" requires explicit package name ...
>>     

-- 
Oliver Schulze L.   | Get my e-mail after a captcha in:
Asuncion - Paraguay | http://tinymailto.com/oliver 




More information about the MIMEDefang mailing list