new_2_perl has asked for the wisdom of the Perl Monks concerning the following question:
I need $Job to hold a few different form variables so that when I print to file they print on the same line separated by colons or something. Help me please!! Thanks# 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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
map is your friend
by marcink (Monk) on Jun 08, 2001 at 00:29 UTC | |
|
Re: cgi.pm param method help
by arturo (Vicar) on Jun 08, 2001 at 00:26 UTC | |
|
Re: cgi.pm param method help
by tachyon (Chancellor) on Jun 08, 2001 at 00:30 UTC | |
|
Re: cgi.pm param method help
by da (Friar) on Jun 08, 2001 at 00:29 UTC | |
|
Re: cgi.pm param method help
by bikeNomad (Priest) on Jun 08, 2001 at 00:32 UTC | |
|
Re: cgi.pm param method help
by new_2_perl (Acolyte) on Jun 08, 2001 at 02:45 UTC |