#!/usr/bin/perl -w use strict; use warnings; my %foo = ( test => { alpha => 'beta', gamma => 'delta', }, ); foreach $foo{zaehler} (keys %{$foo{test}}) { test (\%foo); } sub test { my ($bar) = @_; print "habe " . $bar -> {zaehler} . "\n"; }