View Full Version : TEXTAREA from html and saving it intoa file!

10-01-2002, 06:40 AM

I have made an editor that allows to edit userlist. You can edit the userlist by the following TEXTAREA tag on the HTML code:

print <<End_of_line;
<form method="POST" action="save_userlist.pl">
<table width="690">

foreach $line (@array){
$readout .= "$line";

print <<End_of_Doc;
<textarea name="filetext" wrap="off" rows="30" cols="110">$readout</textarea>

When I edit this and save it, there might be blank lines left after the last entry, which the shows up on a script that loads the content of the file and prints it out.

How can I save the file without the blank lines after the last entry?

10-02-2002, 11:19 PM

foreach $line (@array){
$readout .= $line if ( $line !~ /^$/);

this will skip empty lines.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum