use strict;
use warnings;
use Data::Dumper;
$Data::Dumper::Terse = 1;
$Data::Dumper::Indent = 1;
$Data::Dumper::Useqq = 1;
$Data::Dumper::Deparse = 1;
my %hsh;
my @a=(1,2); # this should be list not array ref
my @b=([3,4],[5,6]); # this should be list conatining array ref
push (@a, \@b); #pushing ref of @b
push (@{$hsh{'one'}}, \@a); #pushing ref of @a
print Dumper(%hsh);
Output:
"one"
[
[
1,
2,
[
[
3,
4
],
[
5,
6
]
]
]
]
Updated:
my %hsh;
my @a=( 1,2 );
my @b=( [3,4],[5,6] );
push (@a, @b); # removed ref of @b
push (@{$hsh{'one'}}, @a); #removed ref of @a
print Dumper(\%hsh);
Output:
{
"one" => [
1,
2,
[
3,
4
],
[
5,
6
]
]
}