#!/usr/bin/perl use strict; use warnings; use constant false => 0; use constant true => 1; $| = true; use Data::Dumper; my $Hash = {}; sub FillHashOne { my %HashOne; { my ($Key, $Value) = @_; if(!defined($Key)) { return(\%HashOne); } else { $HashOne{$Key} = $Value; } } } $Data::Dumper::Indent = 3; $Data::Dumper::Purity = true; $Data::Dumper::Varname = 'Hash'; $Data::Dumper::Quotekeys = true; $Hash->{'One'} = 1; $Hash->{'Two'} = 2; $Hash->{'Three'} = 3; $Hash->{'String'} = 'Foo Bar'; print __LINE__ . ":Main:\$Hash:\n" . Dumper($Hash); for (my $i = 0; $i < 10; $i++) { FillHashOne($i, "Value:\[$i\]"); } $Hash->{'HashOne'} = FillHashOne(undef()); print __LINE__ . ":Main:\$Hash:\n" . Dumper($Hash);