in reply to Newbie help, again

I would investigate perllol, perldsc, and perlref. They'll tell you how to build multi-dimensional data structures in Perl.

Also look at the sort docs; on the whole, though, your sort function will be pretty simple if you create your data structure wisely.

If it were me, I'd create a hash where the keys are your TYPEs, and the values are array references; these array references would hold the "records" read in from your file. This code will help to get you started setting up such a structure:

my %data; while (<>) { chomp; my %rec; @rec{ qw/type url name description/ } = split /,/; push @{$data{$rec{'type'}}}, \%rec; }
You can take a look at the resultant data structure by using Data::Dumper:
use Data::Dumper; print Dumper \%data;
As chromatic said, if you're going to do much more than simple database work, take a look at DBI. DBD::CSV might come in handy for you, or you may want to look at a "real" database, like MySQL. SQL will do a lot of the work for you implicitly if you store your data in a database.