Re: Corrupted Data
From: Tore Aursand (tore_at_aursand.no)
Date: 10/30/03
- Next message: Gary Stainburn: "Re: What is my name"
- Previous message: Bruce Phillip: "RE: Hash Issue or Understanding"
- In reply to: Jimstone77_at_aol.com: "Corrupted Data"
- Next in thread: Jimstone77_at_aol.com: "Re: Corrupted Data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Thu, 30 Oct 2003 18:19:28 +0100
On Thu, 30 Oct 2003 09:45:58 -0500, Jimstone77 wrote:
> open(OLD,">$old") or die "Can't Open File: $!";
> flock OLD, 2;
> open(NEW,$new) or die "Can't Open File: $!";
> flock NEW, 2;
> while (<OLD>) {
> if ($_ =~ /NO_EMAIL/) {
> $count++;
> }
> else {
> print NEW $_;
> }
> }
> close(NEW) or die "Can't Close File: $!";
> close(OLD) or die "Can't Close Old: $!";
First of all: Post your _actual_ code. The code above won't even
compile, and it's really easy to see (or find out) why.
Secondly, you're trying to write to a file you opened for reading.
-- Tore Aursand <tore@aursand.no>
- Next message: Gary Stainburn: "Re: What is my name"
- Previous message: Bruce Phillip: "RE: Hash Issue or Understanding"
- In reply to: Jimstone77_at_aol.com: "Corrupted Data"
- Next in thread: Jimstone77_at_aol.com: "Re: Corrupted Data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]