%hash = ( 'command1' => 'command_name -n $var1 -p $var2' ) $var1 = 'foo'; $var2 = 'bar'; system ($hash{'command'});