Pull data from database to generate XML files
The program asks to input the time first,
before trying to connect to the database.
If the database connection fails,
the user might be frustrated for having entered something only to watch the program crash.
It would be better to move the input part right before it's really needed.

There are some unused elements:


use File::Slurp; appears twice, delete the second
@matrix is never used


The comment at the end of this line is pointless:


my ($time, $report) = @row; #time, report