I have array values that is getting returned from SQL object.
my @keys = $db_obj->SelectAllArrayRef($sql);
print Dumper @keys;
gives
$VAR1 = [ [ '8853' ], [ '15141' ] ];
I need to create string from this array: 8853, 15141.
my $inVal = join(',', map { $_->[0] }, @$keys);
my $inVal;
foreach my $result (@$keys){
$inVal .= $result->[0];
}
my $inVal = join(',', @$keys);
Value i get is ARRAY(0x5265498),ARRAY(0x52654e0). I think its reference to the array. Any idea what am I missing here?
$keysrelated to your$VAR1example ?my ($aref) = $db_obj->....In perl,$keysand@keysare different variables (!).$keysis a scalar variable holding a value or a reference to something else.@keysis an array. Seeperldoc perlreffor the gory details.@keysisn't the same as@$keys.