Your syntax is a little off...
$intHash1Ref = {};
$intHash2Ref = {};
# note use of parens, not curly braces
%containerHash = (hash1 = $intHash1Ref, hash2 = $intHash2Ref);
The parens store a list into %containerHash, the curly-braces were storing a
hash-ref.
Rob
-Original Message-
Yannick Warnier [EMAIL PROTECTED] writes:
Hi,
I'm just trying to make a structure with a hash containing some
references to other (yet unused) hashes.
So what I wrote this:
$intHash1Ref = {};
$intHash2Ref = {};
%containerHash = { hash1 = $intHash1Ref, hash2 = $intHash2Ref};
,, $hashRef-{$hashKeys},\n;
}
}
Output is
C D
A B
-Original Message-
From: Hanson, Rob [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 12:14 PM
To: 'Yannick Warnier'; [EMAIL PROTECTED]
Subject: RE: adding hash reference into hash
Your syntax is a little off
$hashKeys,, $hashRef-{$hashKeys},\n;
}
}
-Original Message-
From: Shishir K. Singh
Sent: Monday, March 03, 2003 12:42 PM
To: 'Hanson, Rob'; 'Yannick Warnier'; [EMAIL PROTECTED]
Subject: RE: adding hash reference into hash
You may want to handle them as
$intHash1Ref
Yannick,
$ perl -e '
%ch = (h1 = {}, h2 = {});
for (keys %ch) {
print$_\n;
}'
h1
h2
Hi,
Hello,
I'm just trying to make a structure with a hash containing some
references to other (yet unused) hashes.
see above.
So what I wrote this:
$intHash1Ref = {};
$intHash2Ref = {};