See
How to add an image to Excel/CSV. I think you are out of luck doing it in a CSV, but there is an example in that node of getting the job done another way. As for adding rows in a CSV though (in a program not command line), just add the command line switches (-pi) to the #!perl line in the first line of the script, and the script would contain something similar to what is in the -e option in the command line example.