Create Free Websites
GrrooP.com
Jimdo.com
MoonFruit
Create Your Own
Designs
Without Tables

Use your knowledge of HTML to turn your template into a website.
Download a FREE Trial
PERL CGI Tutorial
for Writing Interactive Form Scripts
Display a File in a Scrolling Textarea
Simple modifications can be made to display_file.pl to display the multi line file in a scrolling textarea box. The code includes the sorting routine and the split function. A chomp function is added to remove new line characters from the array.
display_textarea.pl
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "<html>\n";
print "<head><title></title></head>\n";
print "<body>\n";
print "<textarea cols=30 rows=4>\n";
open(INFO, "names.txt");
@array=<INFO>;
close (INFO);
chomp(@array);
@sortedarray=sort(@array);
foreach $line (@sortedarray){
($last,$first)=split(/\|/,$line);
print "File Entry: $first $last\n";
}
print "</textarea>\n";
print "</body>\n";
print "</html>\n";
Remember to Refresh the page after modifications.