|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there a simple way to do this? The stuff I've seen so far seems overly complicated for just sorting.? ? ?
any code samples or directions to good examples would be apprecieated. |
|
#2
|
|||
|
|||
|
This might be what you're looking for:
#!/usr/bin/perl -w @a1 = ("one", "two", "three"); @a2 = ("ten", "eleven", "twelve"); @a3 = (100, 200, 300); @r = (@a1, @a2, @a3); $m = @r; # reference to a reference to a list print $m->[1][1], "n"; print "n"; for ($i = 0; ; $i++) { if (defined($m->[$i])) { for ($j = 0; ; $j++) { if (defined($m->[$i][$j])) { print "i$i, j$j: $m->[$i][$j]n"; } else { last } } }else { last } } <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by miguelgarcia: Is there a simple way to do this? The stuff I've seen so far seems overly complicated for just sorting.? ? ? any code samples or directions to good examples would be apprecieated.[/quote] |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Sorting Multidemensional Array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|