Check this directory out and look at the code in the *.t files.:
(The version number -1.32 might change eventually so the link might become "dead". Increment the version number yourself by trial-and-error, or go to the parent directory or click here
and click through via "Browse" to the source code of the newest version)
Text::CSV_XS is a mature perl module for parsing csv files. The *.t files are written in Perl 5, they contain lots of testcases for self-testing the module, they are to be performed at module installation time.