in reply to Array / String

How about this ? -- Personally I think it's clearer and makes your intent more obvious, by YMMV ;)

my @dnsSuffixList = qw ( 10.0.0.1 10.0.02 10.0.03 10.0.04 ); my $str = '#{'; $str .= "#string#$_#;" for @dnsSuffixList; $str .= '}#';