# - - - process_bio_data_in_directory.pl # Responsibility : process global results for all experiments. # Where to find the experiment directories and data files my $DATA_DIR = ‘C:/bio_data/’; my $experiment_dir_regex = qr/Exp/; my $data_file_regex = qr/data_/; ### Comment : i lined these three = signs, but the different font of the didn't leave them lined. That is very annoying, # 1. Find all the experiment directories, and their related data files my $list_experiments = find_experiments_and_their_data_files_in({ dir =>$DATA_DIR, with_experiment_regex => $experim_dir_regex, with_data_file_regex => $data_file_regex, }); ### Comment for the reader : ### an Experiment object will have a path, and a list of data_files. ### I feel that this class makes my code more readable, and i can use $data_file_regex here, ### and not have to think about it again. # 2. Process the data for each experiment my %global_results; EXPERIMENT: foreach my $experiment ( @{$list_experiments} ) { my $hash_aggr_infos = calculate_aggr_info_for_experiment($experiment); process_global_results_with( $hash_aggr_infos, \%global_results ); }