Handling CSV files in perl

I was writing a script to modify .CSV files (ClearQuest export results), and it was incredibly complex due to having multi-line fields (“embedded newlines” in CSV jargon).

After some struggling, I came across a built-in module (at least in ActivePerl 5.12.3) called Text::CSV_XS which basically does everything I wanted. I was able to cut my script length by about 60% and get better performance and (seemingly) bug-free results.
This module is easy to use and has good documentation.

Lesson learnt: re-inventing the wheel is not always the best course of action…


Task Scheduler – A Specified Logon Session Does Not Exist

The above error can appear when you try to create/modify a scheduled task to run as a specific user (schtasks /CHANGE /TN <task name> /RU <user> /RP <password>)

The cause of the error is a specific security policy on the machine.

It can be resolved via either the Local Group Policy Editor, or the Registry Editor (which is handy if you want to script it).

Continue reading