... $FieldName = $cgi->param('Field Name'); ... sub flatFile{ open(FLATFILE, ">> /tmp/flatfile.data") or die $!; #will loop through and tab params, just for testing print FLATFILE $FieldName; close (FLATFILE); }