Help for this page

Select Code to Download


  1. or download this
    my @vslice = (['b','c'],
                  ['i','j'],
                  ['y','z']);
    
  2. or download this
    my @yxslice = ( ['b','i','y'],
                    ['c','j','z'] );
    
  3. or download this
    #! perl -slw
    use strict;
    ...
              [ 'b', 'i', 'x' ],
              [ 'c', 'j', 'y' ]
            ];
    
  4. or download this
    sub vslice  (\@@) { map{ [@{$_}[@_]] } @{+shift}; }
    sub yxslice (\@@) { 
        my $aref = shift; 
        map{ my $i=$_; [ map{ $_->[$i] } @$aref ] } @_; 
    }