use DBI; use Data::Peek; my ($Cposition, $Cyear) = ("00001576", 2014); my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { csv_sep_char => "~", csv_tables => { JPDObj => { f_file => "data/objectives-cqdc.txt", col_names => [qw( Obj PosNbr Year Div AVP Dept SDescr Major Methods Results Accompl JanUp LDescr Changes Chars Goals Budget CFObj )], }, } }); my $sth = $dbh->prepare (qq{select * from JPDObj where PosNbr = ? and year = ?}); $sth->execute ($Cposition, $Cyear); while (my $row = $sth->fetchrow_hashref) { DDumper $row; }