Sorry guys. There's a keyboard shortcut set up on my PC that sends my current mail that I often hit accidentally. It means I occasionally post half-finished mails. I'll knuckle-down and fix it. This is the post as it should have been:
Hi Trevor. Trevor Morrison wrote: > > I am trying to step through each line of a file that contains orders that > were placed through a Internet shopping cart. I have this code: Do you have use strict; use warnings; :? > open(ORDER,$order) or die "Error opening \"$order\": $OS_ERROR\n"; While you're testing I prefer open ORDER, $order or die $! as the closing newline will stop Perl from reporting the source line and filename of the call to 'die'. > print "HI\n"; > while (defined($_ = <ORDER>)) { > print "Hi there \n"; > > I am trying to test each line against a bunch of if statements and then go > on to the next order when the line matches a rag expression and then the data > for the order is dumped to MySql database. Do you mean a regular expression? It's usually best to reiterate /unless/ the order matches some closure criteria. > Now, when I execute the Perl program, it will print the first "Hi", > but fails to print the second "Hi There". Do you just mean 'doesn't print ..' or does your program fail in some way? It's a dangerous thing to retype your code. You will usually type what it's supposed to look like, rather how it actually looks. Try cutting and pasting a copy of part of your your program, when we will be able to guess much better. What you have written is fine except that, as Alan points out, it's the same as while (<ORDER>) BLOCK > I know that I am missing something here, but what is it? Let us know :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]