You can do it all in memory if the list isn't too big. Since it's going to fit in a drop-down box, I presume that's the case. Also, I presume a simple split on the ! character will serve to isolate the fields appropriately (in other words, there are no embedded !s).
Then the trick is to use a hash to remember each distinct occurence. Afterwards you can look at the keys in the hash to retrieve all the unique values. The combination would be something like this (note, this is untested):
my %unique; while (<IN>) { # or whatever the file handle is my @fields = split /!/; $unique{$fields[-1]}++; # last field in the row } my @drop_down = keys %unique; # Et voila
HTH
In reply to Re: building Drop down menu - from a flat file
by VSarkiss
in thread building Drop down menu - from a flat file
by data67
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |