in reply to Creating array name by susbtituting string
Is it possible
It is possible but it is also unwise. Use a HoA instead:
#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my @array = qw/x y z/; my %HoA; foreach my $R2 (@array) { push @{$HoA{$R2}}, $R2 } print Dumper (\%HoA);
See perldsc for how to work with deep structures.
|
|---|