Re: filehandles and while loops

2002-07-27 Thread Connie Chan
Sorry, still can't get your logic... But there's a better approach here : open COUNT,"count.dat"; # ./ mean current dir, so, it's not nessary open TEMP, "temp.dat" ; Then , for the entire loop, you can read from COUNT, and write to TEMP. At last, unlink the COUNT file, then rename the temp.dat

RE: filehandles and while loops

2002-07-27 Thread David Gerler
print COUNT "$image\=$count\n"; } flock(COUNT, 8); close (COUNT) or die "cannot close countfile: $!"; return 1; } -Original Message- From: Connie Chan [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 27, 2002 4:57 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject

Re: filehandles and while loops

2002-07-27 Thread Connie Chan
> > sub count { > > open (COUNT, "+>./count.dat") or die "cannot open countfile: $!"; > > flock(COUNT, 2); > > > > while (){ > > if (m/BC0012/i){ > > ($key, $count) = split('=',$_); > > $found = 1; > > $count++; > > } else { > >

Re: filehandles and while loops

2002-07-27 Thread Yupapa
open(COUNT,") { chomp; if($_ =~ /BC0012/) { my($key,$count) = split('=',$_); $count++; print "$count\n"; } } close(COUNT); "David Gerler" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > okay... see

Re: filehandles and while loops

2002-07-26 Thread John W. Krahn
David Gerler wrote: > > okay... seems tonight is the night for regex... I have been looking at the > emails that have been flying all evening.. I have tried to implement what I > see. > > For some reason, mine don't work. Others say what they got in the email > works. I try it and it don't. > >

filehandles and while loops

2002-07-26 Thread David Gerler
okay... seems tonight is the night for regex... I have been looking at the emails that have been flying all evening.. I have tried to implement what I see. For some reason, mine don't work. Others say what they got in the email works. I try it and it don't. The plan for the code is to read a cou