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

Re: swap columns in a 2-dim array

by tlm (Prior)
on Jun 17, 2005 at 08:59 UTC ( #467623=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    sub fys {
        my $arr = shift;
  2. or download this
    @nums = map [ @{$_}[@cols] ], @nums;
  3. or download this
    my @cols = 0..11;
    do {
      fys( \@cols );
    } until is_deranged( \@cols );
  4. or download this
    sub is_deranged {
      my $arr = shift;
      $arr->[ $_ ] == $_ and return for 0..$#$arr;
      return 1;
  5. or download this
    use strict;
    use warnings;
            @$arr[$i,$j] = @$arr[$j,$i];

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://467623]
[stevieb]: je ne pas parles en Francais, but I prefer a vape, not a pipe ;)
[RonW]: shmem++ # too dumb to debug it

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2017-03-28 22:36 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (342 votes). Check out past polls.