sub makeSql { my $xpid = shift; my $return; my $i = 0; foreach my $item (@$xpid) { $return .= $xpid[$i]; $i++; } return $return; }