use DBI; use Geography::States; my $dbh = DBI->connect( ... ); my $sth = $dbh->prepare('INSERT INTO state(abbrev,name) VALUES(?,?)'); my $usa = Geography::States->new('USA'); $sth->execute(@$_) for $usa->state;