Jump to content
xisto Community

vizskywalker

Members
  • Content Count

    1,084
  • Joined

  • Last visited

Everything posted by vizskywalker

  1. Is the choice of which segment to view going to be set in the script? If so, try this:#---Start Codeopen(INFO, "database.txt");@array=<INFO>;close (INFO);print "Content-type:text/html\n\n";print <<End_of_Head;<html><head><title></title></head><body>End_of_Headmy @otherarray;foreach $line(@array){ chomp($line); ($num,$cat,$name)=split(/\t/,$line); foreach $set ("AA","BB","CC","DD","EE","FF","GG") #This line sets the array for #which categories to pick { if ($cat eq $set) { push(@otherarray,"$num\t$cat\t$name\n") } }}foreach $line (sort byNUM @otherarray){ chomp $line; ($num, $cat, $name) = split(/\t/, $line); print "$name<br>";}print <<End_of_Doc;</body></html>End_of_Doc## Sorting Subroutine ###sub byNUM {@a=split(/\t/,$a);@b=split(/\t/,$;$a[2] cmp $b[2];}#---End CodeThe Database I used is simply two words for each category, one category for each letter.Hope this helps
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.