I would like to start with an empty hash and then insert a hash of the same type of hashes into the hash.
use strict;
use warnings;
my %h = {};
$h{"1"} => {
a => -1,
b => -1,
c => [
{
d => -1,
e => -1,
},
],
};
However it gives
Useless use of hash element in void context at ./hash.pl line 8.
Useless use of anonymous hash ({}) in void context at ./hash.pl line 8.
Reference found where even-sized list expected at ./hash.pl line 6.
This is a kind of database that I would like to create, where I can insert type deletion structures $h{"1"}.
Any ideas how to do this?
source
share