Hi Secode
If you need to get keys as output A B C you just use the below code. Always use Data::Dumper to see the complete stored hash format. I put the print statement in my code just refer that it will show the complete hash format. Your hash format is stored in this format
Your Hash stored format:
$VAR1 = {
'A' => {
'B' => {}
}
};
This output is now stored..so, using this you can get the key output A
+ B C..so, assign some value for the key if you stored values in hash
$VAR1 = {
'A' => {
'B' => {
'C' => 1
}
}
};
#!/usr/bin/perl
use Data::Dumper;
my %line;
$why = "";
$a = A;
$b = B;
$c = C;
$line{$a}{$b}{$c} = 1;
print Dumper(\%line);
$i = 1;
for $a (keys %line) {
for $b (keys %{$line{$a}}) {
for $c (keys %{$line{$a}{$b}}) {
print "$a $b $c\n";
}
}
}
<p>It prints output : A B C