in reply to mysql remote server query

The solution is to use perl to take the mysql query that I get from the remote mysql server and put that data into a csv file on the local mysql client.

Even with your changed requirements, Perl is still neither necessary nor the easiest solution; once you've designed your query, 'echo $query|mysql -h host -u user -p database > Sep.csv' on the local machine will do what you're asking for. If you want to do it in Perl, it'll be at least somewhat more complex - and given that (if I recall correctly from your original request) you're not very familiar with Perl, it's not a solution that I'd suggest, since you wouldn't find it very maintainable.


--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf