in reply to Re: Adding an Entire Class B IP Range to an Array
in thread Adding an Entire Class B IP Range to an Array

[nesting maps] would be quite hard for n levels where n is determined at runtime
That's what Algorithm::Loops 'NestedLoops' is for. And (because I need to practice using it) the solution corresponding to yours would be
use Algorithm::Loops 'NestedLoops'; my @hosts = NestedLoops([([1..254])x2], sub { "192.168.$_[0].$_[1]" }) +;

Caution: Contents may have been coded under pressure.