NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Sort in the database (Score:2)
Class::DBI considered a hinderance (Score:1)
Yeah, what autarch said.
This is why gave up Class::DBI – it very nearly forces you to do on the Perl side what should be done at the SQL level because it makes it way too difficult to do the latter. First you run into a wall of no documentation, then you often have to put up with annoying verbiage. After reading the source for 15 minutes, I think the following will do what you need:
Note that
sth_to_objects()is not documented anywhere. The code should work, but I cannot tell since I’m not going to spend another 15 minutes setting up all the knobs and handles that testing Class::DBI code requires. If it does not work, the least-effort approach will require more red tape. Compare to plain DBI to get an AoH, which is clearly documented and took me 40 seconds to write:Plain DBI is at times crufty, but at least it doesn’t get in your way. As a bonus, it has much less overhead. Class::DBI is seductive, and will whisper in your ear that you that you don’t need to get your hands dirty with all that SQL, but in practice I’ve found it fails to deliver. Last not least, Class::DBI’s dependencies are legion.
Reply to This
Parent