"George Mpouras" <> writes:
> Actually thats what I did. It works ( I wonder why ... )
>
>
> # Open Files
> foreach my $key1 (keys %File)
> {
> foreach my $key2 (keys %{$File{$key1}})
> {
> $File{$key1}{$key2} = { FH => undef ,
The assignment is not needed: The first time the other code uses
$File{$key1}{$key2}{FH} in a rvalue context which needs a reference
to a 'value' of some type, a suitable value will be created and a
reference to it assigned to the hitherto 'undefined' location
(so-called 'auto-vivification'). One of these contexts is the first
argument to an open call which is either supposed to be the name of a
typeglob or a reference to a type glob, cf the following example:
--------------
open($passwd, '<', '/etc/passwd');
print($passwd, "\n");
--------------
which (on a system where a file named /etc/passwd exists

prints
the reference to the anonymous glob which was assigned to $passwd when
autovivification took place.
As Peter Makholm already wrote earlier: The error in your original
code was that you wrote
*FH => undef
in a hash definition. The =>-operator automaically quotes its left
argument if "it begins with a letter or underscore and is composed
only of letters, digits and underscores" (=> perlop(1)). This is not
the case here, hence *FH is evaluated as an expression. The value of
this expression is the typeglob currently associated with the name FH
in the symbol table of the current package, which causes the warning
to be printed. It will probably also not do what you wanted wrt
creating a hash entry because *FH stringfies to the fully-qualified
name of the referenced typeglob, cf
-----------
my $h = { *FH => 'FH' };
print $h->{*FH}, "\n";
package haha;
print $h->{*FH}, "\n";
print("The solution: ", keys(%$h), "\n");
-----------
[in German, the letter 'h' is pronounced 'ha']