Truthless <> wrote:
> This script is supposed to read a html file and
> replace certain sections of it with its own variables.
There are plenty of already designed, implemented, tested and
supported templating systems.
I'd use one of those rather than invent yet another one...
You don't need to do this. It has already been done (repeatedly).
> The issue I am having is getting the $variables to be parsed if the html
> is pulled from a file. As I am doing here...
> open(content,"$confile") or dienice("Cant open $confile : $!");
That will break when the Next Version of Perl introduces a
new function named content().
You should use UPPER CASE for filehandles.
You also have a useless use of double quotes, see the Perl FAQ:
What's wrong with always quoting "$vars"?
open(CONTENT, $confile) or dienice("Cant open '$confile' : $!");
> @ary = <content>;
my $html = join '', <CONTENT>; # a slow and tedious way of slurping
> There must
> be something basic I am looking for.
Lookup the $/ variable in perlvar.pod.
Enable slurp mode.
--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas