use Data::Dumper; sub foo { return ({J=>'A', P=>'H', }, [4.019,5.8]); } # ... original listy assignment here ... print Dumper(\%baz);