my ($cmd, @params) = split ',', <$inputFileHandle>; if (exists $hashOfAllowedCommands{$cmd}) { $worksheet->$hashOfAllowedCommands{$cmd}->(@params) }else{ print "Invalid command ignored in config file at line $.\n"; }