T
tonyshirt
I'm using Active state 5.8 and writing for windows. I have a very
simple parser that writes a csv file (Comma separated Values). It
looks like this:
eval{
open APOUT, ">APresults.csv" || die "Can't open file
APresults.csv!";
foreach my $seqID (keys %hashRef){
if (grep {$_ eq $seqID} @SNPlower){
print APOUT
"$hashRef{$seqID}{PNLNUM},$seqID,$hashRef{$seqID}{SBEStrand},$hashRef{$seqID}{SBE},$hashRef{$seqID}{WARN}";
print APOUT "\n";
}
}
close APOUT;
};
if ($@){
print $@;
}
I noticed when I accidentally had the file APresults.csv open I get
this:
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
which is exactly how many times I call the print statement in the loop.
My question is if the file can't be opened because its busy with
another process, shouldn't the open just die?
simple parser that writes a csv file (Comma separated Values). It
looks like this:
eval{
open APOUT, ">APresults.csv" || die "Can't open file
APresults.csv!";
foreach my $seqID (keys %hashRef){
if (grep {$_ eq $seqID} @SNPlower){
print APOUT
"$hashRef{$seqID}{PNLNUM},$seqID,$hashRef{$seqID}{SBEStrand},$hashRef{$seqID}{SBE},$hashRef{$seqID}{WARN}";
print APOUT "\n";
}
}
close APOUT;
};
if ($@){
print $@;
}
I noticed when I accidentally had the file APresults.csv open I get
this:
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 101, <>
line 230.
print() on closed filehandle APOUT at APResults parse.pl line 102, <>
line 230.
which is exactly how many times I call the print statement in the loop.
My question is if the file can't be opened because its busy with
another process, shouldn't the open just die?