Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My problem is simply I have one array containing lots of numbers in ascending order. I also have a smaller array containg a few select numbers:
The problem is that the numbers in @small should be in the same consecutive order as that of @numbers (e.g should contain: @small = ('78.6' , '78.8', '79.0', '79.2', '79.4'); ).e.g. my @numbers = ('76.8', '77.0', '77.2' ,'77.4', '77.6', '77.8' , '78.0' + , '78.2', '78.4', '78.6' , '78.8', '79.0', '79.2', '79.4', '79.6', ' +79.8' ,'80.0' , '80.2' , '80.5' ,'80.7' ,'80.9',' '81.1'); my @small = ('78.6' , '78.8', '79.0', '80.9', '77.0');
How can I devise a check that compares the order in @small to that of @numbers and changes any anomalies like in the array above ???(even if the first or last numbers are wrong). Many thanks,
Illogical monk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array logic!
by Abigail-II (Bishop) on Aug 06, 2003 at 12:33 UTC | |
|
Re: Array logic!
by BrowserUk (Patriarch) on Aug 06, 2003 at 12:33 UTC | |
by Abigail-II (Bishop) on Aug 06, 2003 at 12:36 UTC | |
by BrowserUk (Patriarch) on Aug 06, 2003 at 12:40 UTC | |
by Abigail-II (Bishop) on Aug 06, 2003 at 12:43 UTC | |
by BrowserUk (Patriarch) on Aug 06, 2003 at 12:46 UTC | |
| |
|
Re: Array logic!
by bobn (Chaplain) on Aug 06, 2003 at 13:06 UTC | |
|
Re: Array logic!
by Abstraction (Friar) on Aug 06, 2003 at 12:24 UTC | |
by Abigail-II (Bishop) on Aug 06, 2003 at 12:28 UTC |