Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hi i have a perl script that whe

Status
Not open for further replies.

kickinpretty

Technical User
Jul 26, 2002
17
GB
hi

i have a perl script that when initiated writes to a specific file, however i need to modify this so that the file it writes to is user defined ie...file path passed via a variable from some remote client..and then stored on the server.

Here is my perl script...

#!/usr/bin/perl

require "subparseform.lib";
&Parse_Form;

$v1 = $formdata{'v1'};

@New = ("v1=$v1");

open (LOG, ">/var/ || &ErrorMessage;
print LOG "@New";
close (LOG);


print "Content-type: text/html\n\n";
print "status=Success - Your database has beed updated. Please reload the data to check updates";

sub ErrorMessage {
print "Content-type: text/html\n\n";
print "status=Connection Failed...Please email full details to serversupport@myserver.com";
exit;
}

Any help with this would be cool....open log is the path to my text file..this is what i need to be user defined..ie some user wants to create and write to a new text file called text2.txt...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top