How to return an HTML page from a Perl script ?

Discussion in 'Perl Misc' started by Rodney, Sep 23, 2003.

  1. Rodney

    Rodney Guest

    1. I want to have a ahref link, on an HTML page, point to a PERL script.
    2. The Perl script will open an existing HTML document and change some of
    its content.
    3. After altering the HTML document, I want it to be returned to the Web
    Client.


    I don't want to re-write the entire HTML document with in the PL script
    (because then the HTML document can not be easily edited using an HTML
    editor). I only want to change certain content then return the document to
    the client.

    How do I do that?

    The PERL script changes the document.... but then it doesn't "return" it ??



    Thanks,
    --
    ....
    `·.¸¸.·´¯`·.¸¸.·´¯`·-> rodney
     
    Rodney, Sep 23, 2003
    #1
    1. Advertising

  2. Rodney wrote:
    > 1. I want to have a ahref link, on an HTML page, point to a PERL script.
    > 2. The Perl script will open an existing HTML document and change some of
    > its content.
    > 3. After altering the HTML document, I want it to be returned to the Web
    > Client.

    Read up on the redirect method in the CGI.pm documentation
    (http://stein.cshl.org/WWW/software/CGI/#header is a good place to start).
     
    Andras Malatinszky, Sep 23, 2003
    #2
    1. Advertising

  3. "Rodney" <> wrote in
    news:ZpYbb.20243$:

    > 1. I want to have a ahref link, on an HTML page, point to a PERL
    > script. 2. The Perl script will open an existing HTML document and
    > change some of its content.
    > 3. After altering the HTML document, I want it to be returned to the
    > Web Client.



    HTML:: Template can help: http://html-template.sourceforge.net/

    Sinan.
     
    A. Sinan Unur, Sep 23, 2003
    #3
  4. Rodney

    Rodney Guest

    I found a simple way to do it.

    No CGI libraries or anything is required.

    NOTE: It's important to include the \n\n and the return value of 1


    ===============================

    $theUrl = http://www.yourplace.com


    sub Redirect_page {
    print "Location: ", $theUrl,"\n\n";

    1;
    }





    ===============================
    --
    ....
    `·.¸¸.·´¯`·.¸¸.·´¯`·-> rodney
     
    Rodney, Sep 23, 2003
    #4
  5. Rodney

    Rodney Guest

    NOTE:
    In my previous post, I defined the URL link and the Newsgroup caused it to
    be a URL-Link.... So, you're not seeing the double quots around it. You
    must include double quotes around the URL address... ie; "your URL here"

    --
    ....
    `·.¸¸.·´¯`·.¸¸.·´¯`·-> rodney
     
    Rodney, Sep 23, 2003
    #5
  6. Rodney

    C. Olive Guest

    "Rodney" <> wrote in message news:<ZpYbb.20243$>...
    > 1. I want to have a ahref link, on an HTML page, point to a PERL script.
    > 2. The Perl script will open an existing HTML document and change some of
    > its content.
    > 3. After altering the HTML document, I want it to be returned to the Web
    > Client.
    >
    >
    > I don't want to re-write the entire HTML document with in the PL script
    > (because then the HTML document can not be easily edited using an HTML
    > editor). I only want to change certain content then return the document to
    > the client.
    >
    > How do I do that?
    >
    > The PERL script changes the document.... but then it doesn't "return" it ??
    >


    I see you've already received the answer I would have offered:
    HTML::Template. Highly recommended. If you need a sample interaction
    to help you put the pieces together, just say so and I'll drop one
    here for you to look at. Examples always help... :cool: HTML::Template
    rocks...

    Chris
    -----
    Chris Olive
    chris [I'm at] technologEase [dot] com
    http://www.technologEase.com
    (pronounced "technologies")
     
    C. Olive, Sep 23, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wet Basement
    Replies:
    1
    Views:
    2,590
    BobMonk
    Jul 15, 2003
  2. dpackwood
    Replies:
    3
    Views:
    1,863
  3. Stu
    Replies:
    2
    Views:
    821
    Rob McAninch
    Apr 6, 2004
  4. Greenhorn
    Replies:
    15
    Views:
    884
    Keith Thompson
    Mar 6, 2005
  5. pj
    Replies:
    3
    Views:
    321
Loading...

Share This Page