Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Reordering Arrays?

by BrowserUk (Patriarch)
on Jul 28, 2006 at 14:24 UTC ( [id://564365]=note: print w/replies, xml ) Need Help??


in reply to Reordering Arrays?

Like this?

my @orig_array = qw(0 1 1 0 1 0 0 0 1 1 1 0 0 0 0); my @new_index_order = qw(8 3 4 9 11 6 7 0 14 10 1 12 2 5 13);; my @new_array = @orig_array[ @new_index_order ];; print @new_array;; 1 0 1 1 0 0 0 0 0 1 1 0 1 0 0

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://564365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-20 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found