I think it must be a perl problem, cause everyone here, and everyone I've talked to says the same thing. If you can reverse sort it, you can sort it.
Is there a way to sort the file itself (database.txt) after I add a new record but keeping the header row in place? I guess I could do it that...
The file is a flat text file
name|address|category
John|122 Mockingbird|Tools
Header row with about 120 lines under it.
I think the reason the script crashes is because when I'm sorting the heading row is also sorted. But then why doesn't it crash when I reverse sort. I'm telling you this...
if(open(CSV,$_[0])){
}
else{
print "<HTML><HEAD><TITLE>Error message</TITLE><BODY>\n";
print "<B>Error:</B> Can't open CSV file.\n";
print "<BR>Please, check that you have provided the cgi script with correct CSV file";
print " path in \$CSV_file variable.\n";
print "</BODY></HTML>"...
Hi everybody,
I have a really stupid sort problem that I haven't been able to figure out. Although, not entirely a novice I've just spent 4 hours trying to sort an array.
Okay here it is:
I have a database.txt file with a header row such as
name|address|category
John|122 Mockingbird|Tools...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.