in reply to array from query to db

An easier way of doing this would be:

my $sth = $dbh->query($query); @ip = $sth->fetchcol(1);

If you are looking for a faster method to retrieve your data you should take a look at the DBI documentation, particularly at the fetchrow_arrayref method and prepare/execute/bind. The Mysql module is just a wrapper on top of DBI, so you're already using it internally, but if you're going to do something a bit more involved it'll be easier to use DBI directly.


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan