#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $hashref = { data => 'test', PUBLIC => { data4 => 'test4' } }; %{ $hashref->{PUBLIC} } = ( %{ $hashref->{PUBLIC} }, data2 => 'test2', data3 => 'test3', ); print Dumper $hashref;