CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
A Little bit of help on editing files

 



SaiyanM
User

Oct 20, 2001, 11:23 AM

Post #1 of 2 (611 views)
A Little bit of help on editing files Can't Post

How would i be able to open up a file, print out its HTML into a textbox, be able to edit it, and then save it?

Anyhelp is appreciated



ultimategamer2k
User

Oct 21, 2001, 8:57 AM

Post #2 of 2 (601 views)
Re: A Little bit of help on editing files [In reply to] Can't Post

well, open the file like you would normally, and set the contents of the file to an array

open (FILE, "/path/to/file");
@contents=<FILE>;
close FILE;

then print it in a text box

print qq(<textarea rows="2" name="modded" cols="20">@contents</textarea>);

then when the user submits it, do something like this

open(FILE, ">path/to/file");
print FILE @mod_contents;
close FILE;

keep in mind that you are going to have to set up a variable to take the contents of the text area.

if you need more clarification, email me


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives