use strict; use warnings; use Template; use CGI qw( header ); my @scripts = qw( main1.js main2.js ); print header(); my $tt2 = Template->new; $tt2->process(\*DATA, { title => "", script_includes => \@scripts, script_body => "alert('Oh, noes!');", }) or warn $tt2->error; exit 0; __DATA__ [% title || "I swear to RTFM in the future" %] [%- FOR script IN script_includes %] [%- END %]

Oh, hai! I can haz script?