in reply to Missing the if statement and going directly to else

put a print "[$main::fields[0]][$PartNumber]\n"; before the if statement, and let us know what the results are.

Replies are listed 'Best First'.
Re: Re: Missing the if statement and going directly to else
by Bismark (Scribe) on Jan 16, 2003 at 23:27 UTC
    It prints the first record in the text file and then skips to the line that matches and prints that. Then it goes into the sub called in the else part of the block.
      Then it does not print the part number? Funny, an empty regex matches any string. Or perhaps the PartNumber has a newline and/or carriage return?