#!/usr/bin/perl use strict; use warnings; use Data::Printer; my %hash = ( key => get_value('test'), key2 => 33, ); sub get_value { return } p %hash;