LostS has asked for the wisdom of the Perl Monks concerning the following question:
Now... I need to also sort the array first by field 3 like it does but also by field 4...my @sorted_list = map { $database_in[ $$_[0] ] } sort { $$a[1] cmp $$b[1] } map { [ $_, (split /\t/, $database_in[ $_ ])[3] ] }(0..@database_ +in-1);
perl -e '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat! +\n"; } else { print "Thats a dog\n"; } print "\n";'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sort Question (Again) :(
by davorg (Chancellor) on Oct 19, 2001 at 20:20 UTC | |
by Hofmator (Curate) on Oct 19, 2001 at 20:28 UTC | |
by LostS (Friar) on Oct 19, 2001 at 20:34 UTC | |
by pixel (Scribe) on Oct 22, 2001 at 12:31 UTC | |
by runrig (Abbot) on Oct 19, 2001 at 20:53 UTC | |
by LostS (Friar) on Oct 19, 2001 at 20:28 UTC | |
by dragonchild (Archbishop) on Oct 19, 2001 at 20:30 UTC | |
by LostS (Friar) on Oct 19, 2001 at 20:36 UTC | |
|
Re: Sort Question (Again) :(
by runrig (Abbot) on Oct 19, 2001 at 20:39 UTC | |
by LostS (Friar) on Oct 19, 2001 at 20:56 UTC |