[32461] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3728 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 2 06:09:17 2012

Date: Mon, 2 Jul 2012 03:09:02 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 2 Jul 2012     Volume: 11 Number: 3728

Today's topics:
    Re: using HTML::Template effectively <cal@example.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 02 Jul 2012 02:34:04 -0600
From: Cal Dershowitz <cal@example.invalid>
Subject: Re: using HTML::Template effectively
Message-Id: <9JudnVwmD8JhwWzSnZ2dnUVZ_qydnZ2d@supernews.com>

On 06/27/2012 01:25 AM, Peter Makholm wrote:
> Ben Morrow<ben@morrow.me.uk>  writes:
>
>>> It's too much work cleaning up after the nasal demons when they get on
>>> your keyboard.
>>
>> In principle there are no nasal demons in Perl. If perl ever does
>> something undefined, that's a bug in perl (or possibly in an XS module
>> you've loaded).
>
> The result of my having both compile-time and run-time effects comes
> pretty close to being not really defined and not really a bug.
>
> At least perlsub from 5.8.8 does not specify what happens when you
> by-pass the run-time effects, but I'm am pretty sure it would be
> considered a bug to remove this "feature" and 5.10 provided a new
> keyword just to make this feature official and clear.

Thx,  Makholm, I finally have output (talking too much about C reminds 
me of bad times)

$ perltidy -b temp1.pl
$ perl temp1.pl
Content-Type: text/html

            <html>
            <head><title>Test Template</title></head>
            <body>
            My Home Directory is /home/dan
            <p>
            My Path is set to 
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
            </body>
            </html>

$ cat temp1.pl
#!/usr/bin/perl -w
use strict;

use HTML::Template;

# open the html template
my $template = HTML::Template->new( filename => 'template.tmpl' );

# fill in some parameters
$template->param( HOME => $ENV{HOME} );
$template->param( PATH => $ENV{PATH} );

# send the obligatory Content-Type and print the template output
print "Content-Type: text/html\n\n", $template->output;

$


I get this, and I have to tell you, what the obligatory content of an 
html page was a bit of a mystery to me.

I'm enjoying the reading.  I got YAMl installed along the way.  It had 
never taken before.  questions:

q1)  I rent a web domain from www.1and1.com .  Would they be able to 
replicate what I just did with my own machine?  Who types in perl 
temp1.pl when a browser wants to see a web page.

remark:  notice how unmunged the html is with the perltidy command!

q2)  How would you perltidy something that was supposed to look like 
well-crafted html?

I'm sure I've made 30 mistakes in this post, and I'd like to say that I 
could get on this right away, but I can't, because the real world 
beckons, which is a happy occasion, because I got the lutherhaven bid, 
in no small part to being able to show what I do on the web using perl 
as a platform.

Peace.
-- 
Cal


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3728
***************************************


home help back first fref pref prev next nref lref last post