# configuration variables my $path = '/saw3/cgi-bin/BXJOH27/'; my $job_file = 'job.txt'; my $location_file = 'Inv_CLLI.txt'; # assign form data to variables my $Job = $q->param('Job_ID'); my $Location = $q->param('Inv_CLLI'); # print our data to a file print_to_file("$path/$job_file", $Job); print_to_file("$path/$location_file", $Location); # print data to file sub print_to_file { my $file = shift; my $data = shift; open (FILE, ">>$file") || die "Unable to open file: $!"; # flock (FILE, LOCK_EX) || # die "Can't get an exclusive lock on $file: $!"; print FILE "$data\n"; close FILE; }