projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed all instances of FileHandle to IO::File
[spider.git]
/
perl
/
DXMsg.pm
diff --git
a/perl/DXMsg.pm
b/perl/DXMsg.pm
index a43880a2987dc729d77bac8c29e199ce9d3ca82b..13af2cc02eac81e6bb85369add0fa39b3ce4a75e 100644
(file)
--- a/
perl/DXMsg.pm
+++ b/
perl/DXMsg.pm
@@
-26,7
+26,8
@@
use DXProtVars;
use DXProtout;
use DXDebug;
use DXLog;
use DXProtout;
use DXDebug;
use DXLog;
-use FileHandle;
+use IO::File;
+use Fcntl;
use Carp;
use strict;
use Carp;
use strict;
@@
-67,6
+68,13
@@
$forwardfn = "$msgdir/forward.pl"; # the forwarding table
keep => '0,Keep this?,yesno',
);
keep => '0,Keep this?,yesno',
);
+sub DESTROY
+{
+ my $self = shift;
+ undef $self->{lines};
+ undef $self->{gotit};
+}
+
# allocate a new object
# called fromnode, tonode, from, to, datetime, private?, subject, nolinesper
sub alloc
# allocate a new object
# called fromnode, tonode, from, to, datetime, private?, subject, nolinesper
sub alloc
@@
-323,7
+331,7
@@
sub store
if ($ref->{file}) { # a file
dbg('msg', "To be stored in $ref->{to}\n");
if ($ref->{file}) { # a file
dbg('msg', "To be stored in $ref->{to}\n");
- my $fh = new
FileHand
le "$ref->{to}", "w";
+ my $fh = new
IO::Fi
le "$ref->{to}", "w";
if (defined $fh) {
my $line;
foreach $line (@{$lines}) {
if (defined $fh) {
my $line;
foreach $line (@{$lines}) {
@@
-343,7
+351,7
@@
sub store
dbg('msg', "To be stored in $fn\n");
# now save the file, overwriting what's there, YES I KNOW OK! (I will change it if it's a problem)
dbg('msg', "To be stored in $fn\n");
# now save the file, overwriting what's there, YES I KNOW OK! (I will change it if it's a problem)
- my $fh = new
FileHand
le "$fn", "w";
+ my $fh = new
IO::Fi
le "$fn", "w";
if (defined $fh) {
my $rr = $ref->{rrreq} ? '1' : '0';
my $priv = $ref->{private} ? '1': '0';
if (defined $fh) {
my $rr = $ref->{rrreq} ? '1' : '0';
my $priv = $ref->{private} ? '1': '0';
@@
-412,7
+420,7
@@
sub read_msg_header
my @f;
my $size;
my @f;
my $size;
- $file = new
FileHand
le;
+ $file = new
IO::Fi
le;
if (!open($file, $fn)) {
print "Error reading $fn $!\n";
return undef;
if (!open($file, $fn)) {
print "Error reading $fn $!\n";
return undef;
@@
-457,7
+465,7
@@
sub read_msg_body
my $fn = filename($msgno);
my @out;
my $fn = filename($msgno);
my @out;
- $file = new
FileHand
le;
+ $file = new
IO::Fi
le;
if (!open($file, $fn)) {
print "Error reading $fn $!\n";
return undef;
if (!open($file, $fn)) {
print "Error reading $fn $!\n";
return undef;
@@
-615,7
+623,7
@@
sub next_transno
my $fn = "$msgdir/$name";
my $msgno;
my $fn = "$msgdir/$name";
my $msgno;
- my $fh = new
FileHand
le;
+ my $fh = new
IO::Fi
le;
if (sysopen($fh, $fn, O_RDWR|O_CREAT, 0666)) {
$fh->autoflush(1);
$msgno = $fh->getline;
if (sysopen($fh, $fn, O_RDWR|O_CREAT, 0666)) {
$fh->autoflush(1);
$msgno = $fh->getline;
@@
-634,7
+642,7
@@
sub next_transno
# initialise the message 'system', read in all the message headers
sub init
{
# initialise the message 'system', read in all the message headers
sub init
{
- my $dir = new
FileHand
le;
+ my $dir = new
IO::Fi
le;
my @dir;
my $ref;
my @dir;
my $ref;