Instead of push @{main::hd}, [@main::a];
you either wanted to write
push @{main::hd}, $main::a;
or
push @{main::hd}, [@$main::a];
If you had used use strict; use warnings Perl would have told you that @main::a is an undefined value. Only the scalar (reference to an array) $main::a is defined by you (in line 2).