http://www.perlmonks.org?node_id=1040416


in reply to Re: How to include a variable in output for derived subnets
in thread How to include a variable in output for derived subnets

Hi poj,

Thanks - that pretty much did the trick. I had to tweak the print code block a little as I got a compilation error, but it works a treat. Appreciate your assistance.

As is the way - this has thrown up the next thing to fix - i found some subnet definitions don't end up with a name (the IPs have no comment), I guess I can iterate over the subnets hash and substitute any undef comments with a value. Initially, I did a find/replace in the output CSV file, but it would be nice to resolve it in the code. I'll have a look into this.

The demo program is really useful, thanks. I need to have a proper look at it, but my initial guess as to how the original code is working out the subnets is that rather than doing any de-duplication of subets or similar, it is just populating a subnet address and prefix into the hash and if the same one already exists, it just get overwritten.

Thanks again, appreciate your help.

  • Comment on Re^2: How to include a variable in output for derived subnets