#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    5
    Rep Power
    0
    Hello, please help me... I am so fedup to keep on having to edit html code inside .pl scripts, and I keep on making mistakes with the / and and the print command and on and on.

    Therefore, I would like to know:

    a) how can I implement into scripts a template include,
    as Links does. I did already look inside the code but
    did not understand.

    b) is there perhaps a software out there which modifies
    "normal" html code into perl (with the "printf" stuff)
    on the fly?

    Thank you very much indeed for your help!
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Cindy Hi,


    you can escape from some characters using "" in perl.but most of the time it is very difficult to edit the html portion with this escape slash.

    you can overcome this problem.
    you can use qq().

    eg:

    print qq|

    <html>
    <head>
    </head>

    <body>
    <h1>Test Message</h1>
    </body>
    </html>

    |;


    simply it will print the html file.


    another way is that,

    if you can use cgi.pm module you can simply type your html as following..


    print <<EOF;
    #just print the html

    <html>
    <head>
    </head>

    <body>
    <h1>Test Message</h1>
    </body>
    </html>

    EOF



    ------------------
    SR -
    shiju.dreamcenter.net

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    5
    Rep Power
    0
    Thanx for your reply... and how can I manage to have separate .html files which the scritp will use as templates? As f.eg. LINKS (gossamer-threads) does?

    thanx"!
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>a)how can I implement into scripts a template include, as Links does.

    option #1:
    require "server_path/to/template_file";

    option #2:
    qq~
    <html>
    <body>
    html codes here
    </body>
    </html>
    ~;

    option #3:
    print "Content-type: text/htmlnn";
    print <<HTML_OUTPUT;
    <html>
    <body>
    Hello World!
    </body>
    </html>
    HTML_OUTPUT

    b) is there perhaps a software out there which modifies "normal" html..
    No.

    #############################################
    >>I keep on making mistakes with the / and and the print command

    If you can't get thru this beginning stage of Perl or you just don't like it, then Perl is not for you.
    Yes, you can jump right to my three options above immediately but if you really want to learn, you first need to be patient and figure out the syntax errors.
    Likewise, Redhat users rely on GUI too much, they learn nothing in return. GUI is mainly for two kind of people: 1) ease of configuration and time consuming for people who know how to configure things manually
    2) lazy to learn, just want to get things running ASAP.

IMN logo majestic logo threadwatch logo seochat tools logo