Thread: Sorting

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Norman, OK, USA
    Posts
    12
    Rep Power
    0
    Hello,
    I am having a small problem with sorting the following:

    @Rows

    $Rows [0][0] = ref0
    $Rows [0][1] = title0
    $Rows [0][2] = desc0
    $Rows [1][0] = ref1
    $Rows [1][1] = title1
    $Rows [1][2] = desc1
    $Rows [2][0] = ref2
    $Rows [2][1] = title2
    $Rows [2][2] = desc2

    @sorted = sort {$Rows{$a->[0][1]} <=> $Rows{$b->[0][1]}} @Rows;


    Any advice/help/rewrites would be appreciated.

    -Loki
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    You should go to -> http://www.perl.com/CPAN-local/modules/by-module/Sort/ and download Sort-Fields-0.90.tar.gz

    Fields.pm is a must-use perl module for every perl coders.

    If you don't have root access to install it, simply upload Fields.pm to "Sort" directory and specify the following lines to your script like so:

    use lib '/path/to/parent/directory/of/Sort';
    use Sort::Fields;

IMN logo majestic logo threadwatch logo seochat tools logo