SV *make_aoa_c( int n_rows, int n_cols ) { int i, j; char *foo = "foo"; AV *table = newAV(); AV *row; for ( i = 0; i < n_rows; ++i ) { row = newAV(); for ( j = 0; j < n_cols; ++j ) { av_push( row, newSVpv( foo, 0 ) ); } av_push( table, newRV_noinc( row ) ); } return newRV_noinc( table ); } #### $ ./751041.pl 1 1: 78836 (233391 us) 2: 78872 (216509 us) 3: 78872 (206672 us) 4: 78872 (206775 us) 5: 78872 (206308 us) 6: 78872 (207777 us) 7: 78872 (206677 us) 8: 78872 (206739 us) 9: 78872 (206675 us) 10: 78872 (205979 us) #### $ ./751041.pl 0 1: 78696 (213442 us) 2: 78704 (208485 us) 3: 78704 (175431 us) 4: 78704 (175438 us) 5: 78704 (175422 us) 6: 78704 (175486 us) 7: 78704 (175667 us) 8: 78704 (175647 us) 9: 78704 (175682 us) 10: 78704 (175687 us)