in reply to
Memory usage with DBI
The fetchrow_array and fetchrow_arrayref methods retrieve data from the datasource one single row at a time, and thus the system that the script is running on only has to deal with one row's worth of data at a time.
The query results may be queued up in a buffer on the database side, but the database is optimized for that sort of thing.
Overall, the DBI module is quite memory efficient. I've got a similar script running on my webserver that queries about a hundred thousand rows of data, generates HTML pages using the data, and copies the whole thing over to another machine. This batch takes about 10 to 15 minutes to run, even with all the disk I/O and querying going on, and has no effect on the other processes going on with that machine.
I wouldn't worry too much about it! :)