|
|
Question : "splice" 2D arrays
|
|
I have a 2D array, and I need to do the equivalent of removing a row or a column. Splice works well to remove a single element from a 1D array. What is the best (i.e. easiest, yet working) way to do it for a 2D array?
Thanks
|
Answer : "splice" 2D arrays
|
|
@arr=(['a','b','c','d'],['e','f','g'],['h','i','j']); splice @arr,1,1; for( @arr ){ splice @$_,1,1 };
|
|
|
|
|