Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$digits = 4; $order = 4213; $rearrangeme = 9876;
| Would Lead To.. |
|
7869 would be the final result.
After trying to acheive this with an elaborate series of split, s///, and substr, I spent about 2 hours trying to debug it, but to no avail. I'm sure theres probably some really simple way of doing this using a hash or something that I am just overlooking.
Thanks a lot for any help you could offer.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Rearranging Numbers
by quidity (Pilgrim) on Nov 23, 2000 at 08:53 UTC | |
by a (Friar) on Nov 23, 2000 at 11:22 UTC | |
|
Re: Rearranging Numbers
by Dominus (Parson) on Nov 23, 2000 at 21:16 UTC | |
|
Re: Rearranging Numbers
by fundflow (Chaplain) on Nov 23, 2000 at 11:00 UTC | |
|
Re: Rearranging Numbers
by galande (Initiate) on Nov 23, 2000 at 14:12 UTC |