use Template; my $template = Template->new; $template->process(\*DATA) || die $template->error(); __DATA__ [% USE DBI( ... ) %]