#!/usr/bin/perl use warnings; use strict; package childmodul; sub new { my $classname = shift; my $self = {hsh_scriptParam => shift}; return bless($self, $classname); } sub set_Data { my $self = shift; my $args = {@_}; my $i; my %h = %{$self->{hsh_scriptParam}}; print $h{DBParam}->{dbSession}->{runtime}->{dbTable}; print "\n"; my %h2 = %{$args}; print $h2{wert} . "\n"; $h{DBParam}->{dbSession}->{runtime}->{dbTable} = $h2{wert}; $self->showResult(); } sub showResult { my $self = shift; my %h = %{$self->{hsh_scriptParam}}; print "Result: "; print $h{DBParam}->{dbSession}->{runtime}->{dbTable}; print "\n"; } package main; my $hsh_runtimeParam = { ScriptParam => {ScriptName => $0 || '???', Version => 'v.01' || '???', Hilfe => {Usage => 'ruf mich mal richtig auf', Message => 'rufe mal nach Mutti'}, }, Runtime => {ApplName => 'TestClass', Caller => $^O =~ /win32/i ? $ENV{USERNAME} : $ENV{USER}, Loglevel => 'höher geht nicht', RootPath => 'ganz oben' || '???', StartTime => 'am Anfang' || '???', }, DBParam => {RegPar => 'test', dbSession => {ApplName => 'testhash', Action => 'insert', runtime => {dbTable => 'INIT_REG'} } } }; my $Object1 = childmodul->new($hsh_runtimeParam); $Object1->set_Data(block => {test => [ 'DBParam', 'dbSession', 'runtime' ]}, key => 'dbTable', wert =>'INIT_RUN');