in reply to Variable access using other variable data
A slightly different approach:
>perl -wMstrict -le "my %fruits = ( pear => { apple => { peach => 'pear_apple_peachy', }, damson => { orange => 'pear_damson_orangish', }, }, ); ;; my ($ch1, $ch2, $ch3) = qw(pear damson orange); ;; print qq{a $ch1-$ch2-$ch3 is $fruits{$ch1}{$ch2}{$ch3}} " a pear-damson-orange is pear_damson_orangish
See perldsc.
|
|---|