My array of hashes:
@cur = [
{
'A' => '9872',
'B' => '1111'
},
{
'A' => '9871',
'B' => '1111'
}
];
Expected result:
@curnew = ('9872', '9871');
Any simple way to get only the values of the first hash element from
this and assign it to an array?
First your array have to be defined as
Note the parenthesis