#!/usr/bin/perl use warnings; use strict; use Data::Dumper; sub make_hashref {{ foo => 'bar', }} sub make_hashref2 {{ boo => 'too', %{ make_hashref() }, }} sub make_hashref3 {{ %{ make_hashref() }, boo => 'too', }} print Dumper make_hashref(); print Dumper make_hashref2(); print Dumper make_hashref3();