Daniel, Daniel Staal wrote on 29.04.2004:
>--As of Thursday, April 29, 2004 10:43 AM +0200, Jan Eden is alleged >to have said: > >>I have a piece of HTML code containing two Perl variable names, >>which is to be used in 6 scripts. So I tried to put it into a >>separate file to be executed with "do page_head.pl", where >>page_head.pl contains something like (simplified): >> >>my $page_head = qq{<?xml version="1.0" encoding="utf-8"?><!DOCTYPE >>html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" >>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html >>xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" >>lang="de"><head><title>$title</title></head><body><a >>href="show_local.pl?id=$mother_id" class="head" >>target="_self">UP</a><div class="textbox"><!-- begin content -->}; >> >>The obvious problem is, that the variables are not interpolated >>according to their current value in the scripts, i.e. although > >--As for the rest, it is mine. > >Just out of curiosity: would using HTML::Template be terrible >overkill? This seems to be the type of thing it was designed for... You're right. When posting various snippets of code on different mailing lists, people keep recommending HTML::Template, and I always promise to myself to write template files. But every time a script works, I tend to think "Well, so much for that, now for the next task." Laziness which backfires quite regularly. And this time, I will... I hope I will use HTML::Template. - Jan -- There are 10 kinds of people: those who understand binary, and those who don't -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>