J
Justin C
I can't see what I'm doing wrong here. My program is doing what
I want it to do, using a module I wrote to interface with
Mailman, but I'm getting:
GLOB(0x2d86348)close failed in file object destructor:
Error in sys.excepthook:
Original exception was:
My program extracts recently added email addresses from a
database of prospects and adds them to Mailman mailing list
manager using the commandline Mailman tools:
package MyModules::Mailman;
use strict;
use Carp;
use IPC::Open2
sub add_subscribers {
my (undef, $mailinglist, $addresses) = @_;
my ($in, $out, $pid) = connect_to_list($mailinglist);
for my $address (@{ $addresses }) {
print {$in} $address, "\n";
print {$out} "Added: <$address>\n";
}
close $in;
close $out;
waitpid($pid, 0);
my $exit_status = $? >> 8;
print "Exit status: ", $exit_status, "/n" if $exit_status;
}
sub connect_to_list {
my $mailinglist = shift;
my $cmd = '/usr/lib/mailman/bin/add_members';
my @opts = ('--regular-members-file=-', '--welcome-msg=n', '--admin-notify=n');
my @args = ($cmd, @opts, $mailinglist);
my ($in, $out);
my $pid = open2($out, $in, @args);
return ($in, $out, $pid);
}
1;
=======
I believe the problem is within the module, and not the calling
program, which uses the module thusly:
use strict;
use warnings;
use MyModules;
my $results = extract_new_addresses(); # an arrayref to list of email addresses
my $return_val = MyModule::Mailman->add_subscribers('prospects', $results);
print "Return value: ", $return_val, "\n";
=======
I usually spot any howlers when I prepare these messages, but
nothing has jumped out at me. Any suggestions why I'm getting
the error would be gratefully received.
Justin.
I want it to do, using a module I wrote to interface with
Mailman, but I'm getting:
GLOB(0x2d86348)close failed in file object destructor:
Error in sys.excepthook:
Original exception was:
My program extracts recently added email addresses from a
database of prospects and adds them to Mailman mailing list
manager using the commandline Mailman tools:
package MyModules::Mailman;
use strict;
use Carp;
use IPC::Open2
sub add_subscribers {
my (undef, $mailinglist, $addresses) = @_;
my ($in, $out, $pid) = connect_to_list($mailinglist);
for my $address (@{ $addresses }) {
print {$in} $address, "\n";
print {$out} "Added: <$address>\n";
}
close $in;
close $out;
waitpid($pid, 0);
my $exit_status = $? >> 8;
print "Exit status: ", $exit_status, "/n" if $exit_status;
}
sub connect_to_list {
my $mailinglist = shift;
my $cmd = '/usr/lib/mailman/bin/add_members';
my @opts = ('--regular-members-file=-', '--welcome-msg=n', '--admin-notify=n');
my @args = ($cmd, @opts, $mailinglist);
my ($in, $out);
my $pid = open2($out, $in, @args);
return ($in, $out, $pid);
}
1;
=======
I believe the problem is within the module, and not the calling
program, which uses the module thusly:
use strict;
use warnings;
use MyModules;
my $results = extract_new_addresses(); # an arrayref to list of email addresses
my $return_val = MyModule::Mailman->add_subscribers('prospects', $results);
print "Return value: ", $return_val, "\n";
=======
I usually spot any howlers when I prepare these messages, but
nothing has jumped out at me. Any suggestions why I'm getting
the error would be gratefully received.
Justin.