in reply to array from query to db

(Hey, that looks like a nice node for posting a plugging reply. Let's click it and see. Hm, indeed, it's suitable for a shameless DBIx::Simple plug.)

Consider using my module DBIx::Simple, which would allow you to simply write:

use DBIx::Simple; my $dsn = "dbi:mysql:host=$host;database=$dbname"; my $db = DBIx::Simple->connect($dsn, $user, $pass); my @ip = $db->query('SELECT ip FROM mal_switch')->flat;

In any case, please don't use the deprecated Mysql module, but something that is more generic. In addition, please indent according to syntax, not semantics. It's cute, but not easy to read or maintain.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }