in reply to Re: Shifting of 2D array slices
in thread Shifting of 2D array slices

@bigarray = map [ map split( /\*/ ), @$_ ], @bigarray;
The second map is not neccessary. The return value of map can be a list, so
@bigarray = map [ split /\*/ ], @bigarray;
will do fine, too.


holli, /regexed monk/

Replies are listed 'Best First'.
Re^3: Shifting of 2D array slices
by kyle (Abbot) on Dec 07, 2008 at 03:37 UTC

    split, by default, operates on $_, but the elements of @bigarray are references. You need to explicitly dereference them and then split the elements. That's why the internal map is necessary. Your suggestion leaves @bigarray looking this way:

    $VAR1 = [ [ 'ARRAY(0x504290)' ], [ 'ARRAY(0x531f00)' ], [ 'ARRAY(0x531e60)' ] ];