I suck at perl as you can probably tell… I am using a script to apply changes to a Cisco device using Net::Application::Session. I have 2 arrays, 1 is the interface and 1 is the interface description. I need the commands “$s->cmd[]” to be entered like so:
$s->cmd("interface $configDescription");
$s->cmd("description >> WAP - $desName <<");
But I cannot figure out how to do it with a foreach statement. Below is what I am currently doing, this only changes the last line in the Array. Please Advise… I am a noob to this site, if this isn’t enough information please tell me what is needed. Thank you.
foreach $configDescription (@changeme) {
foreach $desName (@changename) {
$s->cmd("interface $configDescription");
$s->cmd("description >> WAP - $desName <<");
};
};
They are called parallel arrays.
Or: (destructive)