gri6507 has asked for the wisdom of the Perl Monks concerning the following question:
A=[1, 2, 3, 4 ]
I am trying to parse the file until that last "]". I know a long way of doing this, but I want to know why this doesn't work
open(FIL, $file) || die "can't open file $^E\n"; while(chomp($_ = <FIL>) ne "]"){ #do stuff }
Apparently, the While loop is never terminated, and reads past the end of the file. Any ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing Test File
by VSarkiss (Monsignor) on Jan 15, 2002 at 21:05 UTC | |
|
Re: Parsing Test File
by davis (Vicar) on Jan 15, 2002 at 20:57 UTC | |
by Aristotle (Chancellor) on Jan 15, 2002 at 23:00 UTC | |
by gri6507 (Deacon) on Jan 15, 2002 at 21:05 UTC | |
|
Re: Parsing Test File
by broquaint (Abbot) on Jan 15, 2002 at 21:07 UTC | |
|
Re: Parsing Test File
by talexb (Chancellor) on Jan 15, 2002 at 21:25 UTC |