use strict; use warnings; my %struct = (data => 1, pointers => []); print "Data is $struct{data}.\n"; print "There are ", scalar @{$struct{pointers}}, " pointers allocated.\n"; push @{$struct{pointers}}, "hello world", "the end is neigh", "this is the end"; print "$_\n" for @{$struct{pointers}}; print "There are ", scalar @{$struct{pointers}}, " pointers allocated.\n"; #### Data is 1. There are 0 pointers allocated. hello world the end is neigh this is the end There are 3 pointers allocated.