soon_j has asked for the wisdom of the Perl Monks concerning the following question:
In the above example, if:use FileHandle; $fh = new FileHandle; $fh->open("<c:\\test.txt") || die ("Could not open file!!!!. $!"); until ($fh->eof) { $tmp = $fh->getline; # If $tmp starts with any number followed by a period (it means that + the part after the period is the question portion), do FUNCTION1 # If $tmp starts with a "letter" followed by a period (it means that + this is one of the choices), do FUNCTION2 } $fh->close;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Reading a File by Line then Analyzing each Line
by japhy (Canon) on Jun 06, 2006 at 16:36 UTC | |
Re: Reading a File by Line then Analyzing each Line
by thundergnat (Deacon) on Jun 06, 2006 at 17:54 UTC | |
Re: Reading a File by Line then Analyzing each Line
by ahmad (Hermit) on Jun 06, 2006 at 16:41 UTC | |
Re: Reading a File by Line then Analyzing each Line
by neniro (Priest) on Jun 06, 2006 at 18:06 UTC | |
Re: Reading a File by Line then Analyzing each Line
by GrandFather (Saint) on Jun 06, 2006 at 19:37 UTC |