The Best Practices suggest using CPAN modules for more complex data parsing, instead of trying to roll your own.
Please, please. please listen to this suggestion. Importing data is hard, and the modules on CPAN have spent a lot of time and effort to get this right. The modules suggested are good and fast and handle most of the strange corner cases for you.
Please don’t reinvent this wheel. You’ll do it badly, and spend more time than you think.