On Tuesday, August 05, 2003 12:13, Trevor Morrison wrote:
>
>Hi,
>
>I am trying to step through each line of a file that contains orders that
>were place through a internet shopping cart. I have this code:
>
> open(ORDER,$order) or die "Error opening \"$order\": $OS_ERROR\n";
>
>print "HI\n";
> while (defined($_ = <ORDER>)) {
You can replace this line with
while (<ORDER>) {
That will read each line stopping at the end. And $_ will have the line
contents each time.
> print "Hi there \n";
>
>I am trying to test each line against a bunch of if statements and then go
>onto the next order when the line matches a rag expression and then the
data
>for the order is dumped to MySql database. Now, when I execute the Perl
>program, it will print the first "Hi", but fails to print the second "Hi
>There". I know that I am missing something here, but what is it?
Something regarding your use of defined(), but I'm not really sure what the
problem is...
HTH,
Alan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]