#!/usr/bin/perl use strict; use warnings; use DBI; my $dbh = DBI->connect("dbi:Pg:dbname=MY_DB;host=localhost", 'MY_Server', 'VERYSECRET', {AutoCommit => 0}) or die("Can't connect"); my $sth = $dbh->prepare_cached("INSERT INTO arraytesttable (array_id, array_values) VALUES (?, ?)") or die($dbh->errstr); my @english = qw(Hello world); my @german = qw(Hallo Welt); $sth->execute('ger', \@german) or die($dbh->errstr); $sth->execute('eng', \@english) or die($dbh->errstr); $dbh->commit;