#my main.pl where i parse the yaml file $input_file = $ARGV[0]; print "Input File = $input_file\n"; # parse the yaml file $yaml_input = YAML::XS::LoadFile("$input_file"); #these are my parse functions : sub parse_yaml_run_tgt($) { my ($yaml_input) = @_; $run_target_platforms = $yaml_input->{run_target_platforms}; @run_target_id = (); @run_target_controls = (); @run_target_con_info = (); my $i = 0; for my $run_index (@$run_target_platforms) { $run_target_id[$i] = $run_index->{run_target_id}; $run_target_controls[$i] = $run_target_id[$i]->{target_controls}; $run_target_types[$i] = $run_target_controls[$i]->{run_target_type}; $run_target_active[$i] = $run_target_controls[$i]->{run_target_active}; $run_target_con_info[$i] = $run_target_id[$i]->{target_connection_info}; $run_target_hostname[$i] = $run_target_con_info[$i]->{run_target_hostname}; $i++; } } sub parse_yaml_standalone($) { my ($yaml_input) = @_; $standalone_exec = $yaml_input->{standalone_execution}; $utpsm_exec = $standalone_exec->{utpsm_executable}; $se_hostname = $utpsm_exec->{hostname}; $se_tgt_list = $standalone_exec->{target_list}; $se_rulesfile = $standalone_exec->{rulesfile}; } #and this is my yaml file : ################################################ # Input file for uTPSM regression test control # ################################################ test_control: standalone_execution: yes code_checkout: no #yes/no rules_file: - rules_file_id: &rulesid_01 name: hostname: - rules_file_id: &rulesid_02 name: run_target_platforms: - run_target_id: &runid_01 target_controls: run_target_type: simulator #simulator, emulator , hardware run_target_active: yes target_connection_info: standalone_execution: utpsm_executable: hostname: rulesfile: [*rulesid_01] target_list: [*runid_01] ...