use strict; use DBI; my $driver = "mysql"; my $dns = "database=baxy"; my $username = "baxy"; my $password = ""; my $dbh = DBI -> connect ("dbi:$driver:$dns", $username, $password, {AutoCommit => 1}); my $titula = [qw(ing dipl. dipl.ing. dr phd)]; my $wage = [qw(10 20 30 50 200)]; my $sth = $dbh->prepare ("update Staff set wage = @$wage where position = ?") or die "$DBI::errstr"; foreach my $x (@$titula) { $sth -> execute($x)|| die "$DBI::errstr"; } $sth -> dump_results();