use strict; use warnings; my %data; # Replace this with real code to generate %data. %data = ( foo1 => [ '1 - 201 - 229', '2 - 201 - 229', '3 - 201 - 229', ], foo2 => [ '1 - 201 - 218', '2 - 201 - 218', '3 - 201 - 218', '4 - 201 - 218', '5 - 201 - 218', '6 - 201 - 218', '7 - 201 - 218', ], ); use File::Slurp; use Data::Dumper; $Data::Dumper::Useqq = 1; write_file( 'big_decision_hashref.dat', Dumper(\%data) ) ; #use YAML::Syck; $YAML::Syck::ImplicitTyping = 1; #DumpFile( 'big_decision_hashref.yml', \%data ); #### use strict; use warnings; use Data::Dumper; $Data::Dumper::Useqq = 1; my $data_href = do 'big_decision_hashref.dat'; #use YAML::Syck; $YAML::Syck::ImplicitTyping = 1; #my $data_href = LoadFile( 'big_decision_hashref.yml' ); die unless $data_href; my $dataset = $ARGV[0] || 'foo1'; my $act_bsites_aref = $data_href->{$dataset} or die "Invalid dataset '$dataset'"; my @act_bsites = @{ $act_bsites_aref }; #print Dumper \@act_bsites; # For debugging