Search an entry into a CSV file should be easy with PEAR::File package. I've recently used the version 1.2.0 and found a problem.
Once a csv file was opened, it won't be well closed, so a new search failed, especially if entry is before the latest entry searched.
Today (May, 6 2005) the PEAR CVS repository has this file CSV.php,v 1.20 2005/03/31 05:50:46 dufuz Exp
Have a look on method getPointer() on lines 128 to 155
Remove lines 130 to 135, 140 and 147 (like [3]) and all will run fine