[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] using printf




9/14/1999, Democco atcher wrote:
    I really appreciate that suggestion.  I am very new to PERL
    and XML.  Actually I don't know how to use XML as I am just
    now reading about it.  Anyhow-do you know how I would go
    about putting the HTML part into a template?  What does that
    involve?  I know that the explanation is probably something
    that will only make me ask more questions, so if you know of
    any resources I peruse to help me, let me know.  I have
    emile (an XML editor for the Mac) would that help me?


Dear Democco,

Here's an excerpt from one of my own ad-hoc template files:

    -----------------------------------------
    <html>
    <head>
        <title>n.html</title>
        <base target=$DocTarget>
    </head>
    <body>

    <hr size=20>
    <br>

    <center>
            <a href=$PrevIndexNum.html#$LastPrWord target=cx>
                View previous block of entries
            </a>
    </center>

    </body>
    </html>
    -----------------------------------------

This is simply a self-standing file, eg, 'template.1.html'.

I just read the file into a string, and then do substitutes for all the
'$varb' constructs, as in:

	$Str =~ s/\$PrevIndexNum/$PrevIndexNum/ ;

After all the substitutes, you just write the string out to the appropriate
file name.

Hope this helps,
rkm
http://cyberjournal.org/quay_largo/


----------------------------------------------------------------------------


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org