Subject: | bug with open bases simultaneously |
Date: | Tue, 15 Mar 2011 01:57:43 +0300 |
To: | bug-FTN-JAM [...] rt.cpan.org |
From: | A B <abolychev [...] gmail.com> |
patch:
--- lib/FTN/JAM.pm 2010-08-23 02:09:33.000000000 +0400
+++ lib/FTN/JAM.pm 2011-03-07 22:31:28.000000000 +0300
@@ -130,56 +130,57 @@
}
my $jampath = $_[0];
+ my ($JHR,$JDX,$JDT,$JLR);
- my $jhrres = open( JHR, "+<" . $jampath . ".jhr" );
- my $jdxres = open( JDX, "+<" . $jampath . ".jdx" );
- my $jdtres = open( JDT, "+<" . $jampath . ".jdt" );
- my $jlrres = open( JLR, "+<" . $jampath . ".jlr" );
+ my $jhrres = open( $JHR, "+<" . $jampath . ".jhr" );
+ my $jdxres = open( $JDX, "+<" . $jampath . ".jdx" );
+ my $jdtres = open( $JDT, "+<" . $jampath . ".jdt" );
+ my $jlrres = open( $JLR, "+<" . $jampath . ".jlr" );
if ( !$jhrres or !$jdxres or !$jdtres or !$jlrres ) {
if ($jhrres) {
- close(JHR);
+ close($JHR);
}
if ($jdxres) {
- close(JDX);
+ close($JDX);
}
if ($jdtres) {
- close(JDT);
+ close($JDT);
}
if ($jlrres) {
- close(JLR);
+ close($JLR);
}
$Errnum = FTN::JAM::Errnum::IO_ERROR;
return;
}
- binmode(JHR);
- binmode(JDX);
- binmode(JDT);
- binmode(JLR);
+ binmode($JHR);
+ binmode($JDX);
+ binmode($JDT);
+ binmode($JLR);
my $old;
- $old = select(JHR);
+ $old = select($JHR);
$| = 1;
select($old);
- $old = select(JDX);
+ $old = select($JDX);
$| = 1;
select($old);
- $old = select(JDT);
+ $old = select($JDT);
$| = 1;
select($old);
- $old = select(JLR);
+ $old = select($JLR);
$| = 1;
select($old);
my %filehash;
- $filehash{jhr} = *JHR;
- $filehash{jdx} = *JDX;
- $filehash{jdt} = *JDT;
- $filehash{jlr} = *JLR;
+ $filehash{jhr} = $JHR;
+ $filehash{jdx} = $JDX;
+ $filehash{jdt} = $JDT;
+ $filehash{jlr} = $JLR;
return \%filehash;
}