in reply to Getting Value

Why it's stupid to `use a variable as a variable name'
my %dirs = ( log => "hello", ... }; my $dir_type = function1(); die("Unknown dir type $dir_type\n") if !exists($dirs{$dir_type}); my $dir = $dirs{$dir_type};

Replies are listed 'Best First'.
Re^2: Getting Value
by perlvel (Initiate) on Jul 24, 2009 at 09:30 UTC
    Thanks . It works.
    Svel