I understand you've got your script working but I just wanted to point out a potential problem with this line:
my $config = XMLin();
Calling XMLin() with absolutely no parameters is a bit of a 'red flag'. In your case, you want the XML file to be found automatically, so leaving the first parameter undefined is OK; but you're expecting the <profile> elements to be 'folded' into a hash keyed on the contents of the 'name' attribute. Unfortunately, if config file is edited and there's only one <profile> element in it, things will go horribly wrong. I'd recommend:
my $config = XMLin(undef, keyattr => { profile => 'name'}, forcearray => [ 'profile' ], );
Read more here.
In reply to Re: XML::Simple and variable interpolation
by grantm
in thread XML::Simple and variable interpolation
by amonotod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |