Re: Perl + Dreamweaver?



Nikos wrote:
What i want to do is "Separation of HTML and code".

That's what HTML::Template, or any templating system, would help you with.

I though that i can create my fancy hmtl page with dreamweaver and then somehow(dont know how) join my code and html so they work together) Is that possbile with dreamweaver? i must somehow create the html too...

If you please give a simple example of how can i simple perl script work with html::template i would be grateful. I took a look at perldoc.com but i didnt understand it.

Even if HTML::Template is slightly more sophisticated, the example below illustrates what the whole thing is about. Assume this in mytemplate.html:


<html><head><title>%HEADER%</title></head>
<body><h1>%HEADER%</h1>
<p>This is a %VAR1% for illustrating the
principles with a %VAR2%.</p>
</body></html>

and this CGI script:

#!/usr/bin/perl -T
use strict;
use warnings;
use CGI;
my $q = CGI->new;
my %tmplvar = (
    HEADER => 'My Template',
    VAR1   => 'template',
    VAR2   => 'templating system',
);
open my $tmpl, '<', 'mytemplate.html' or die $!;
my $output = do { local $/; <$tmpl> };
$output =~ s/%([^%\s]+)%/$tmplvar{$1} or "%$1%"/eg;
print $q->header, $output;
__END__

I don't use Dreamweaver, but I suppose that you can use it to edit such a template to your liking.

HTH

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.



Relevant Pages

  • Re: puchased web template-cant get psd file to pull in
    ... boxedart.com member and I am fairly decent with Dreamweaver, ... websites, BUT when I really want to change the template and graphics, ... actual content of the page and it reverts to the images folder instead ... "I then open the html file in Dreamweaver to edit the actual content of the ...
    (comp.graphics.apps.photoshop)
  • Re: Use FP 2003 on a site developed with other software?
    ... Hi, Murray, and many thanks for your informative reply. ... I thought that some of the HTML on the newer pages looked sort of, um, ... > A Dreamweaver page should be a piece of cake for you to bring into FP. ... > the pages are under control of a Dreamweaver template, ...
    (microsoft.public.frontpage.client)
  • Re: Use FP 2003 on a site developed with other software?
    ... Just learn HTML and CSS. ... but I learn fast...where can I get some pointers ... >> A Dreamweaver page should be a piece of cake for you to bring into FP. ... >> the pages are under control of a Dreamweaver template, ...
    (microsoft.public.frontpage.client)
  • Re: Cgi.pm and CSS
    ... I have posted a complete and working template ... Why not using Dreamweaver as you like that program? ... But be aware, writing HTML pages ... try to branch out that part of your javascript ...
    (comp.lang.perl.misc)
  • Re: is anyone here going to help me??? does anyone here know anything at all???
    ... I am very sure that if I post my broken template and they ... Until like three or four days ago, everything on my blog displayed ... The generic Google ad beneath the blog title box displayed perfectly. ... I tried to publish and got a broken HTML error. ...
    (rec.gambling.poker)