I have an array like so,
@switch_ports = ()
and then want to add 50 instances of this hash, to the switch_ports array
%port = (data1 => 0, data2 => 0, changed => 0)
however, if I push my hash to the array
push(@switch_ports, %port)
but if I do print @switch_ports I just see
data10data20changed0
so it just seems to be added them to the array, (joining them) and if I try and loop the array and print the keys, it also fails.
I think i am going retarded from smashed my head into the desk so hard.
1 - Can you store a hash in an array?
2 - Can you have an array of hashes?
Trying to get...
switchports
0
data1
data2
changed
1
data1
....
thus
foreach $port (@switchport) {
print $port['data1']
}
would return all of the data1 for all of the hashes in the array.
Yes, I fail at Perl