use XML::Simple; my $fh = IO::File->new('/root/regions.xml'); my $data = XML::Simple::XMLin($fh); $data->{root}->{configs}->$VAR->{region_prefix}