我需要将哈希转换为perl中的数组哈希
我有:
%hash = (
tinku => 15,
tina => 4,
rita => 18,
tinku => 18,
tinku => 17,
tinku => 16,
rita => 19
);
Run Code Online (Sandbox Code Playgroud)
我想将其更改为:
%hash = ( tinku => [ 15, 16, 17, 18 ], rita => [ 18, 19 ], tina => 4 );
Run Code Online (Sandbox Code Playgroud) perl associative-array hashtable data-structures perl-data-structures