in reply to Declare values in array using Regex

Yet another way:
use Algorithm::Loops qw( NestedLoops ); my @lists = ( [qw( a b )], [ 1..7 ], ); my @array = NestedLoops(\@lists, sub { 'log' . join('', @_) });

It's bigger, but it's very dynamic.