in reply to Re^2: syntax for hashes with variable in name
in thread syntax for hashes with variable in name

is it?

Let's rule out the fact that this deals with symbolic references, strict tells us ...

use strict; use warnings; { no strict "refs"; my $site = "foo"; my @{"platforms_$site"} = qw( foo bar ); my %{"platforms_$site"} = map { $_ => 1 } @{"platforms_$site"}; } => Can't declare array dereference in "my" at xx.pl line 8, near "} =" Execution of xx.pl aborted due to compilation errors.

The difference is in the assignment part. You cannot use my there. When you drop those, you get:

use strict; use warnings; { no strict "refs"; my $site = "foo"; @{"platforms_$site"} = qw( foo bar ); %{"platforms_$site"} = map { $_ => 1 } @{"platforms_$site"}; }

Which is still bad coding style, but this works.


Enjoy, Have FUN! H.Merijn