#!/usr/bin/perl use DBI; my $dbh = DBI->connect; my $sth = $dbh->prepare("INSERT INTO mytable ( name, street, city ) VALUES ( ?, ?, ? )"); $sth->execute; while(defined ( $_ = ) ) { chomp; # ??, name, street, ?, city, ida, id, ?? my @d = split /\|/, $_; $sth->execute($d[1], $d[2], $d[4]); } __DATA__ |John Smith|123 Any Street||Any City|KS|23568| |Mary Smith|123 Any Avenue||Any Town|KS|32546|