Greetings, oh wise ones

I am completely befuddled and am seeking your wise advice. I have separated my befuddlement into separate headings as much as I can.

TT2 and CGI

I started using FB as suggested by oko1 here . I felt encouraged by the ability to use TT2 because I already had some work in that format.

I reworked through the second chapter of ye Badger Book and then reworked the actual site in question making a simple set of templates that worked with static pages and ttree.

Then came the setting up of the CGI side of things. Temporarily I moved the templates aand source files into the cgi directory for this work in progress on my local machine, figuring I could deal with the proper layout of the templates and the cgi later on. First sloppy thing.

Now I have a common head element that mostly uses site constant data, the title and keywords might change for a page but stylesheet, javascript file and other headers don't hugely change.

<title>[% sitename %]::[% title %]</title> <base href="[% baseurl%]" /> <meta name="Author" content="[% author %]" /> <meta name="robots" content="[% robot %]" /> <meta http-equiv="expires" content="now" /> <meta http-equiv="pragma" content="no-cache" /> <meta name="keywords" content="[% keywds %]" /> <link rel="stylesheet" href="[% style %]" type="text/css" /> <script src="[% script %]" type="text/javascript"></script> <link rel="shortcut icon" href="[% icon %]" /> </head> <body id="[% pagename %]"> <div id="container">

Using ttree for static page construction, I can pre-process a configs file which simply processes a file called site declaring the fixed data.

Under cgi, I lost this preprocessing capability and I am wondering how to get it back.

I tried [%- INCLUDE site -%] but this didn't seem to load the site data. I tried [%- PROCESS site -%] but that didn't work either, so I ended up simply adding the constant data as declarations in the template which something I am deeply unhappy about. I would prefer constant site data to be separate so that it can be easily maintained.

Working on Email::Valid

So far so good...Then I tried Email::Valid. For such a simple module I managed to spend a lot of time on this but I eventually got what I wanted with this snippet

my $emv = Email::Valid->new(); $emv->tldcheck(1); $emv->mxcheck(1); $addr = $emv->address(-address => $addr) if $addr;

I couldn't figure out how to set tldcheck and mxcheck successfully within one call to Email::Valid->address. If there is a way would someone let me know?

An installation problem

I discovered that I had the default Debian version of FB in it's usual place of /usr/share/perl5/ This is version 3.03.

However, I was playing around with CPAN some time ago and have ended up with version 3.0501 in

/usr/local/share/perl/5.8.8/CGI
Similar things happen for Email::Valid. On my local machine, I am using the later versions.

I really need rewind my mistakes with CPAN on my local machine and get back to the default install of perl. This is all on Debian stable machines - except the bits I may have made unstable by playing with CPAN on my local machine .

Ideally I would like then to be able to install and use up to date elements of perl, For example, CGI v3.05 is the default installed on Debian atbel and I'd prefer to use CGI v3.38 if for nothing else but to clear an annoying charset bug. How can I safely do this?

I would like to avoid having to re-install Debian stable to completely rewind my local machine to a safe state. I would prefer to simply remove the perl component and then re-install it. Is this possible?

I did see a document out there that described how to set up a dual perl isntallation without threatening the distribution on which it works but I didn't bookmark the page. Mea culpa. If anyone can point me in the right direction on this it would help me tremendously

Having achieved these aims what would I need to consider if I then change over to mod_perl on Apache v2.x?


In reply to TT2 and FB between two different installations by LesleyB

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.