sub insert_flatfile { # Note: files opened in > mode again to prevent disk space issues open(FF, ">$flatfile") || die "Unable to open '$flatfile': $!"; foreach(@rows) { print FF join('|', ($_->{ID}, $_->{name}, $_->{address}, $_->{city}, $_->{state}, $_->{zip})), "\n"; } close(FF); }