1 2 3 4 5 6 7 8 9 10 11
my %mailTemplates = ( "40" => {"subject" => "Deine neuen Daten", "mailFrom" => "abc\@test.de"}, "41" => {"subject" => "Deine alten Daten", "mailFrom" => "xyz\@test.de"}, "42" => {"subject" => "Deine neuen Daten", "mailFrom" => "abc\@test.de"}, )
1 2 3 4 5 6 7 8
my %mailTemplates = ( "40", "42" => {"subject" => "Deine neuen Daten", "mailFrom" => "abc\@test.de"}, "41" => {"subject" => "Deine alten Daten", "mailFrom" => "xyz\@test.de"} )
1 2 3 4
$mailTemplates{40} = $mailTemplates{42} = {"subject" => "Deine neuen Daten", "mailFrom" => "abc\@test.de"};
1 2 3 4 5
my %mailTemplates; @mailTemplates{40, 42} = ( {"subject" => "Deine neuen Daten", "mailFrom" => "abc\@test.de"} ) x 2;
1 2 3 4 5 6 7
my %mailTemplates =( 40 => do { $_ = {"subject" => "Deine neuen Daten", "mailFrom" => "abc\@test.de"} }, 42 => $_ );
1 2 3 4 5 6 7
my $sharedHashref = {"subject" => "Deine neuen Daten", "mailFrom" => 'abc@test.de'}; my %mailTemplates = ( "40" => $sharedHashref, "41" =>{"subject" => "Deine alten Daten", "mailFrom" => "xyz\@test.de"}, "42" => $sharedHashref, )
1 2 3 4 5 6 7 8 9
my %mailTemplates = ( "40" => {"subject" => "Deine neuen Daten", "mailFrom" => "abc\@test.de"}, "41" => {"subject" => "Deine alten Daten", "mailFrom" => "xyz\@test.de"}, "42" => "40", )
2015-03-06T15:07:37 RaubtierDas erfordert aber eine größere Änderung, da dann bei jedem Zugriff getestet werden muss, was wirklich im Hash liegt.