in reply to Script doesn't enter while loop.
The <> operator reads a line from a file regardless if you set it to anything, so this script will try to read in two lines every time it iterates through the loop. Since you only have a single line, you're going to run into problems here. A better way to code this is :while (<FILE>) { $file_data=<FILE>; }
orwhile( $file_data = <FILE> ) { }
my ( $file_data ) = <FILE>;
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
It's not what you know, but knowing how to find it if you don't know that's important
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Script doesn't enter while loop.
by ChemBoy (Priest) on Aug 23, 2001 at 21:28 UTC |