use strict; use warnings; my $var1 ="a.pl"; my %hash = ( "command1" => "type $var1" ); system ($hash{"command1"});