in reply to Re^6: array refernce as hash value
in thread array refernce as hash value

I tried this way
foreach $key (keys %{$MSISDN_ref}) { print MYFILE $key,"|",@{$MSISDN_ref -> {$key}, "\n"; }
so i got the file as
9344220001|sei10720013,21/07/2009-00-00-00,23/07/2009-12-34-44sei10720 +014,23/07/2009-20-00-23
but i dont want this i want 9344220001|sei10720013,21/07/2009-00-00-00,23/07/2009-12-34-44 9344220001|sei10720014,23/07/2009-20-00-23 I dont how can i achive this

Replies are listed 'Best First'.
Re^8: array refernce as hash value
by ashish.kvarma (Monk) on Jul 22, 2009 at 15:08 UTC
    I can see these issues with your code
    • There is a syntax error in the code. ‘}’ is missing in print statement.
    • Even with the syntax error fixed, the code will not print the array elements but the array refrences. Something like: ‘9344220003|ARRAY(0x23d0e84)ARRAY(0x23c298c)ARRAY(0x2454aa4)’
    $MSISDN_ref->{$key} is an AOA (array of array) so you need to loop over it and print the inner arrays separately.

    Regards,
    Ashish