wube,
I would recommend breaking your data up into a different structure if you can. If you can't, the following should be close to what you want. In fact, it is temporarily creating an alternative structure used to do the sorting and then disgarding it at the end.
#!/usr/bin/perl #!/usr/bin/perl use strict; use warnings; my %dow = ( Sunday => 1, Monday => 2, Tuesday => 3, Wednesday => 4, Thurday => 5, Friday => 6, Saturday => 7 ); my @data = map { chomp; $_ } <DATA>; print "$_\n" for map { $_->[0] } sort { $a->[1] <=> $b->[1] || $a->[2] <=> $b->[2] || $a->[3] cmp $ +a->[3] } map { my @field = split /,/; $field[8] =~ s/\D//g; [ $_, $dow{$field[7]}, $field[8], $field[0] ] } @data; __DATA__ "aix-dev,active,aixr03,aixr03,crmd,FULL,12345,Sunday,018:00:00" "w2k-prod,active,w2k-PROD,pub1hi,prod-web-srv1Y,FULL,3,Friday,021:00:0 +0" "w2k-prod,active,w2k-PROD,pol02pi,prod-web-srv1,CINC,,Monday,009:00:00 +" "w2k-prod,active,w2k-PROD,pub01pi,prod-web-srv1,CINC,,Monday,023:00:00 +0" "aix-dev-ecmd2,active,aixr03,aixr03,ecmD2,FULL,12345,Monday,001:00:00" "aix-prod-artp,active,aixr04,aixr04,artp-rman,FULL,2345,Sunday,021:30: +00" "w2k-prod,active,w2k-PROD,pol02pi,prod-web-srv1Y,FULL,3,Friday,023:00: +00" "w2k-prod,active,w2k-PROD,pub01pi,prod-web-srv1Y,FULL,3,Friday,021:00: +00"
As far as the last question - how to make it efficient. You are going to need to give some idea what you mean by "large" and what resource you are looking for to be efficient with.

Cheers - L~R

See Schwartzian Transform for more information.

In reply to Re: Sort questions by Limbic~Region
in thread Sort questions by wube

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.