如何從下面的數組哈希中刪除一個元素;Perl中數組的哈希值:遍歷和刪除
%HoA = (
flintstones => [ {day=>'19'}, {day=>'21'}, {day=>'22'} ],
jetsons => [ {day=>'29'}, {day=>'23'}, {day=>'25'} ],
simpsons => [ {day=>'26'}, {day=>'33'}, {day=>'27'} ]
);
就像我如何從flintstones
刪除e.g {day=>'21'}
,使結果看起來像;
%HoA = (
flintstones => [ {day=>'19'}, {day=>'22'} ],
jetsons => [ {day=>'29'}, {day=>'23'}, {day=>'25'} ],
simpsons => [ {day=>'26'}, {day=>'33'}, {day=>'27'} ]
);
我試過使用Hash =();但導致undef,
的地方,我在每個陣列刪除
它給出「不是數組引用」 – bilal