in reply to extracting data from file

Use Text::CSV or Text::xSV

Examples at