#!c:/perl/bin/perl
print "Content-type: text/html\n\n";
use CGI;
#######################################################
## © Copyright 2002 All Rights Reserved ##
## Mr. Andrew Jackson ##
#######################################################
#######################################################
##This little bugger here takes the .txt database and##
##sorts it in alphabetical order from A to Z ##
#######################################################
open(items, "itemdat.txt") or die "could not open file";
@list1 = ;
close(items);
$kn = 0;
for ($nk = 0; $nk <= $#list1; $nk){
$item1 = @list1[$nk];
chomp($item1);
$nk++;
$item2 = @list1[$nk];
chomp($item2);
$nk++;
$item3 = @list1[$nk];
chomp($item3);
$nk++;
$item4 = @list1[$nk];
chomp($item4);
$nk++;
$item5 = @list1[$nk];
chomp($item5);
$nk++;
@list[$kn] = "$item1&$item2&$item3&$item4&$item5";
$kn++;
}
$nk = 0;
foreach $list (@list){
local($item1, $item2, $item3, $item4 ,$item5) = split(/&/, $list);
@list1[$nk] = "$item1 \n";
$nk++;
@list1[$nk] = "$item2 \n";
$nk++;
@list1[$nk] = "$item3 \n";
$nk++;
@list1[$nk] = "$item4 \n";
$nk++;
@list1[$nk] = "$item5 \n";
$nk++;
}
open(items, ">itemdat.txt");
print items "@list1";
close(items);
####################################
##This is the end of little bugger##
####################################
print "Diablo II Broth - Items";
open(items, "itemdat.txt") or die "could not open file";
@contetnsoffile = ;
close(items);
$nk = 0;
print "The Items We Own as of Now
In the order entered into the database ";
print "
";
print "| Name | Status | Type | Mods | Quanity | ";
$color = "red";
for ($nk = 0; $nk <= $#contetnsoffile; $nk){
print "| @contetnsoffile[$nk] | ";
$nk++;
print "@contetnsoffile[$nk] | ";
$nk++;
print "@contetnsoffile[$nk] | ";
$nk++;
print "@contetnsoffile[$nk] | ";
$nk++;
print "@contetnsoffile[$nk] |
";
$nk++;
if ($color eq red){
$color = "blue";
} else {
$color = "red";
}
}
print "
";