Wow, that's some silly code:-) Yes, you can do this and in some instances running through mysql command might be faster, but the portability, design, expandability of this sucks. You can use placeholders, long column queries, etc... Did this guy write this years and years ago or something, or was he just trying to finish up and hurry and leave? DBI/DBD::MySQL is the way to go, definitely. The interface allows you to do way more things, with better control than the piping does or ever will provide.
Ilya -----Original Message----- From: Kevin Old To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: 4/3/02 2:28 PM Subject: DBI vs. piping query to Mysql Hello all, I am a consultant brought in to manage and restructure some Perl scripts that were written some time ago. The programmer at that time was using the following code to do a query from within a CGI page. ${query} = "SELECT ccyymmddhh FROM inventory ORDER BY ccyymmddhh ;" ; open( INPUT, "echo \"${query}\" | /usr/local/mysql/bin/mysql -A -q -N gso|" ) ; @{ccyymmddhh} = <INPUT> ; chomp( @{ccyymmddhh} ) ; close( INPUT ) ; I think that I should clean this up and reprogram this to use DBD::mysql rather than the way he does it here. Anyone have any idea if it would improve performance? I'd love to hear from people that have gone doing it this way to using DBI. Obviously I can run benchmarks before and after and see which takes longer, and I think that using DBI is not only much easier to read and manage, but probably a little faster. Just seeking the advice of others. Thanks, Kevin [EMAIL PROTECTED]