in reply to no output
I'm curious about something.
First, you slurp in the XML document:
{ local $/ = undef; $xml = <XML>; };
then later, you do a search/replace globally on the entire stringified file:
$xml =~ s/hostname/$hostname/g; $xml =~ s/interface/$interface/g;
What that does on first pass, is replace *all* instances of 'hostname' and 'interface' with the first instance of $hostname and $interface. Without seeing the XML template, it's hard to guess if this is what you want.
Why don't you explain what you're trying to achieve here? It's really not all that clear from what you've provided... are you trying to print out a new file *per host*? That would make the above make sense.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: no output
by DieringerC (Initiate) on Apr 06, 2016 at 20:46 UTC | |
by GrandFather (Saint) on Apr 07, 2016 at 01:22 UTC |