in reply to Joining an array within a text block

You can shorten foreach to for, or hide it in map:
my $list = join "\n", map "<li>$_</li>", @existing_array;

Or, you can use a templating system:

#! /usr/bin/perl use warnings; use strict; use Template; my @array = ('Item 1', 'Item 2'); my $t = Template->new; my $list = << '__TT__'; <html> <body> <ul>[% FOR item IN list %] <li>[% item %]</li>[% END %] </ul> </body> <html> __TT__ $t->process(\$list, { list => \@array }, \*STDOUT);
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ