e:\ Test n_a MSSQL blah SwissTest db_builder pass Test.log create_db.sql blah e:\ Live n_a MSSQL blah Live db_builder pass Live.log create_db.sql blah #### # Load XML Config file... use XML::Simple; my $config = XMLin(); # Find the right config... # This should be the only commandline argument my $desired_config = $ARGV[0]; # Dump the config file.... use Data::Dumper; print Dumper($config); print $config->{$desired_config}->{database_type}; #### print $config->{profile}->{$desired_config}->{database_type}; print "\nTest1\n"; print $config->{profile}->{config}=>$desired_config->{database_type}; print "\nTest2\n"; print $config->{profile}->{config => $desired_config}->{database_type}; print "\nTest3\n"; # Below is the only one that works.... # It is hardcoded... print $config->{profile}->{Test}->{database_type}; print "\nTest4\n"; print $config->{$desired_config}->{database_type}; print "\nTest5\n"; print $config->{profile}->{$desired_config}->{database_type}; print "\nTest6\n"; print $config->{profile}=>{$desired_config}->{database_type}; print "\nTest7\n";