in reply to Re^8: Can't use string as an ARRAY ref
in thread Can't use string as an ARRAY ref

The structures are in this format,I use "unshift" to add the header:
$VAR1 = [ [ '12345', 'MONICA', '01/01/1900', '0X10' ], [ '000001', 'MARY L', '01/01/2000', '0111P' ], [ '8884', 'JOHN M.', '01/01/1932', '0OK8' ], ]; $VAR1 = [ [ 'Main', '1900', 'Red', ], [ 'APT', '1290', 'Blue', ], [ 'AVAL', '1921', 'Green', ], ]; $VAR1 = [ [ 'Q3.0', 'OK', '1900-01-01', 'N', 'O', 'O', 'X', 'Y' ], [ '12w', 'PL', '2000-01-02', 'N', 'P', 'O', 'X', 'A' ], ];

Replies are listed 'Best First'.
Re^10: Can't use string as an ARRAY ref
by poj (Abbot) on Aug 24, 2015 at 17:04 UTC

    I don't mean these structure

    my $princ = $just_data->{$member_number}{princ}; unshift @$princ,["Header 3a", "Header 3b", "Header 3c", "Header 3d"];

    I mean the ones used here

    foreach my $princ_row ( @{$princ} ) { my $member_number = shift @{ $princ_row }; push ( @{ $just_data->{$member_number}{princ} }, $princ_row); }

    There should be member_number common to all 3 structures (princ,type,person) in the first column.
    It's a bit confusing having the same variable name.

    poj