lisaw has asked for the wisdom of the Perl Monks concerning the following question:
I know how to sort the DB using the first entry...Here's what I get to work with:This being my $database file data: ENTRY_A|ENTRY_B|ENTRY_C
Is there an easy way to sort through the database to list the second entry in alphabetical order? ENTRY_B Any answers? Anyone have the phone number to Dr. Kavorkian? :) Thanksopen (ORGDB,"<$database"); @ODB=<ORGDB>; close (ORGDB); @ODB = sort(@ODB); foreach $rec (@ODB){ chomp($rec); ($ENTRY_A,$ENTRY_B,$ENTRY_C)=split(/\|/,$rec); print " $ENTRY_A <BR> $ENTRY_B <BR> Sorted by ENTRY_B $ENTRY_C <BR> \n";
update (broquaint): title change (was Pulling My Hair Out...)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pulling My Hair Out...
by fruiture (Curate) on Nov 22, 2002 at 18:19 UTC | |
|
Re: Pulling My Hair Out...
by rdfield (Priest) on Nov 22, 2002 at 18:21 UTC | |
|
Re: Pulling My Hair Out...
by dreadpiratepeter (Priest) on Nov 22, 2002 at 18:29 UTC | |
|
Re: Pulling My Hair Out...
by strider corinth (Friar) on Nov 22, 2002 at 20:33 UTC | |
|
Re: Pulling My Hair Out...
by rbc (Curate) on Nov 22, 2002 at 19:57 UTC | |
|
Re: Pulling My Hair Out...
by Fletch (Bishop) on Nov 22, 2002 at 20:29 UTC |