Antw: Re: hash of hashes
Roland Bauer
Roland.Bauer at mediaprint.at
Tue Nov 23 05:42:13 CST 1999
* * * vienna-pm-list * * *
Hallo Marcel,
danke fuer den Tip.
(Ich war irritiert dadurch, dass keys unbedingt ein % am
variablenbeginn will)
So funktioniert es:
use strict;
my %x;
$x{33}{44}=7;
$x{33}{45}=8;
$x{33}{46}=9;
for my $y (keys %x) {
print "y = $y\n"; # 33
my $z = $x{$y};
# 444546
print "KEYS = ",(keys %$z),"\n";
}
Roland
--
roland.bauer at mediaprint.at
internet-applikationen
TEL: +43-1-36000/3949
>>> Marcel Grunauer <marcel.grunauer at lovely.net> 23.11.1999 11.42 Uhr >>>
On Tue, 23 Nov 1999 11:13:19 +0100, you wrote:
> * * * vienna-pm-list * * *
> Kann mir bitte jemand auf die Spruenge helfen?
>
> use strict;
>
> my %x;
>
> $x{33}{44}=7;
> $x{33}{45}=8;
> $x{33}{46}=9;
>
> for my $y (keys %x) {
>
> print "y = $y\n"; # 33
>
> my %z = $x{$y};
Das ist eine hashref!
D.h.
$z = $x{$y};
Dann
$z->{45}
etc.
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
###
You are subscribed to vienna-pm-list
http://www.fff.at/fff/vienna.pm/
More information about the Vienna-pm
mailing list