CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Re: [allan1962] Creating alphabetic Sort: Edit Log


Jun 4, 2007, 9:38 AM

Views: 11242
Re: [allan1962] Creating alphabetic Sort

Ok This is what I have so far


open(DATABASE, "datafiles/data.txt") || die "Can't open input";
close (DATABASE);

foreach $data(@data)

($Category) = split(/\|/, $data);
push @db_searchresults, $data;

foreach $data1(@db_searchresults)

chop ($data1);
($Category) = split(/\|/, $data1);
push @db_Category, $Category;


@letters = ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', );

if("$db_Category[0]" eq ""){ print "<BR><div align=center><b><i>No Entry</b><br></div>";

$start = "$in{'start'}";

while ($count) {
$listing[$i] = substr("$db_Category[$i]",0,1);

if("$letters[$nextletter]" eq "$listing[$i]")
{ $urllink[$i] = "<a href='../listing/display.cgi?search=1&searchtype=all&searchtext=$db_Category[$i]'>$db_Category[$i]</a>";
print qq!
<TR valign="top">
<TD class="category">
else {

Results at

I'm getting close, but still missing something in the comparing the first letter.

As you can see, and an earlier post hinted at, I am trying to make an effort here.

Can someone help me with the final steps?

(This post was edited by allan1962 on Jun 4, 2007, 10:11 AM)

Edit Log:
Post edited by allan1962 (Novice) on Jun 4, 2007, 9:55 AM
Post edited by allan1962 (Novice) on Jun 4, 2007, 10:11 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives