Advice about cgi programming

Discussion in 'Perl Misc' started by newbiegalore, Feb 13, 2008.

  1. newbiegalore

    newbiegalore Guest

    Hello everyone :) ,
    I am a newbie to Perl, but have
    experience with other scripting languages. I am putting up this post
    to ask for advice regarding what skills I would need to get a task
    done. This might not be the most appropriate group, but since Perl is
    used a lot for server back-end scripts, I guess a lot of people have
    experience with using it for building web applications.

    My task: I have bought a domain and now want to set up a website on
    it.

    What will the site do: Accept a string from the user, like Google does
    (A very simple design). Then the site will check this string for the
    presence of a substring. The output will be displayed in a simple text
    box on the main page (to begin with).

    If I have a script that will do this operation, I need to link the
    input string to this script in the background and return the result.
    Is CGI programming used to make this "glue" ? I could ask someone to
    access the script directly on my site like

    http://www.mysite.com/myscript<params> .. but I want to separate the
    interface from my programs. Any advice would be greatly appreciated. I
    know how to code in C, C++,Awk, Bash and some more languages. Sorry if
    my questions seems overly naive :D.

    Thanks in advance,
    -A
     
    newbiegalore, Feb 13, 2008
    #1
    1. Advertising

  2. newbiegalore

    Guest

    newbiegalore <> wrote:
    > Hello everyone :) ,
    > I am a newbie to Perl, but have
    > experience with other scripting languages. I am putting up this post
    > to ask for advice regarding what skills I would need to get a task
    > done. This might not be the most appropriate group, but since Perl is
    > used a lot for server back-end scripts, I guess a lot of people have
    > experience with using it for building web applications.


    Isn't that kind of like parking illegally, then turning on your four-way
    flashers to advertise "yes, I know it is illegal, but I am doing it
    anyway"? To be generous, I'll assume you have at least some vaguely
    good-faith intention of considering Perl for your task.

    >
    > My task: I have bought a domain and now want to set up a website on
    > it.
    >
    > What will the site do: Accept a string from the user, like Google does
    > (A very simple design). Then the site will check this string for the
    > presence of a substring. The output will be displayed in a simple text
    > box on the main page (to begin with).


    Every sting will have a substring present in it (the null string if
    nothing else). There is no need to check--it will be there. Are you
    looking for a *specific* substring?

    > If I have a script that will do this operation, I need to link the
    > input string to this script in the background and return the result.


    What do you mean by "in the background"

    > Is CGI programming used to make this "glue" ?


    It certainly can be.

    > I could ask someone to
    > access the script directly on my site like
    >
    > http://www.mysite.com/myscript<params> .. but I want to separate the
    > interface from my programs.


    Your task is so simple I see no benefit to be had from such separation.
    Of course, your task could evolve to be non-simple, but then it would
    depend on what what way it becomes non-simple. It is kind of like saying
    "I want to drive to the capital of some state, but without knowing
    which state it is can you tell me which direction to start driving?"

    > Any advice would be greatly appreciated. I
    > know how to code in C, C++,Awk, Bash and some more languages. Sorry if
    > my questions seems overly naive :D.


    If you know many other languages but not Perl, then you might want to
    consider using one of them and learning only CGI, rather than learning
    both Perl and CGI simultaneously. I know of some Perl modules (CGI.pm,
    mostly) that help do CGI from Perl. I'm sure at least some of those other
    languages have such helper libraries as well, but this being a Perl group
    and all, I don't know of any specifically to recommend for those other
    languages.

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    The costs of publication of this article were defrayed in part by the
    payment of page charges. This article must therefore be hereby marked
    advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
    this fact.
     
    , Feb 13, 2008
    #2
    1. Advertising

  3. newbiegalore

    newbiegalore Guest

    On Feb 12, 9:08 pm, wrote:
    > newbiegalore <> wrote:
    > > Hello everyone :) ,
    > > I am a newbie to Perl, but have
    > > experience with other scripting languages. I am putting up this post
    > > to ask for advice regarding what skills I would need to get a task
    > > done. This might not be the most appropriate group, but since Perl is
    > > used a lot for server back-end scripts, I guess a lot of people have
    > > experience with using it for building web applications.

    >
    > Isn't that kind of like parking illegally, then turning on your four-way
    > flashers to advertise "yes, I know it is illegal, but I am doing it
    > anyway"? To be generous, I'll assume you have at least some vaguely
    > good-faith intention of considering Perl for your task.
    >
    >
    >
    > > My task: I have bought a domain and now want to set up a website on
    > > it.

    >
    > > What will the site do: Accept a string from the user, like Google does
    > > (A very simple design). Then the site will check this string for the
    > > presence of a substring. The output will be displayed in a simple text
    > > box on the main page (to begin with).

    >
    > Every sting will have a substring present in it (the null string if
    > nothing else). There is no need to check--it will be there. Are you
    > looking for a *specific* substring?
    >
    > > If I have a script that will do this operation, I need to link the
    > > input string to this script in the background and return the result.

    >
    > What do you mean by "in the background"
    >
    > > Is CGI programming used to make this "glue" ?

    >
    > It certainly can be.
    >
    > > I could ask someone to
    > > access the script directly on my site like

    >
    > >http://www.mysite.com/myscript<params> .. but I want to separate the
    > > interface from my programs.

    >
    > Your task is so simple I see no benefit to be had from such separation.
    > Of course, your task could evolve to be non-simple, but then it would
    > depend on what what way it becomes non-simple. It is kind of like saying
    > "I want to drive to the capital of some state, but without knowing
    > which state it is can you tell me which direction to start driving?"
    >
    > > Any advice would be greatly appreciated. I
    > > know how to code in C, C++,Awk, Bash and some more languages. Sorry if
    > > my questions seems overly naive :D.

    >
    > If you know many other languages but not Perl, then you might want to
    > consider using one of them and learning only CGI, rather than learning
    > both Perl and CGI simultaneously. I know of some Perl modules (CGI.pm,
    > mostly) that help do CGI from Perl. I'm sure at least some of those other
    > languages have such helper libraries as well, but this being a Perl group
    > and all, I don't know of any specifically to recommend for those other
    > languages.
    >
    > Xho
    >
    > --
    > --------------------http://NewsReader.Com/--------------------
    > The costs of publication of this article were defrayed in part by the
    > payment of page charges. This article must therefore be hereby marked
    > advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
    > this fact.


    I got hold of a nice resource http://hoohoo.ncsa.uiuc.edu/cgi/ ...
    don't really see the need for an illegal car parking analogy
    though :D.. anyway thanks for the comments.
     
    newbiegalore, Feb 13, 2008
    #3
  4. newbiegalore

    newbiegalore Guest

    On Feb 13, 6:02 pm, Jim Gibson <> wrote:
    > In article
    > <>,
    >
    >
    >
    > newbiegalore <> wrote:
    > > Hello everyone :) ,
    > > I am a newbie to Perl, but have
    > > experience with other scripting languages. I am putting up this post
    > > to ask for advice regarding what skills I would need to get a task
    > > done. This might not be the most appropriate group, but since Perl is
    > > used a lot for server back-end scripts, I guess a lot of people have
    > > experience with using it for building web applications.

    >
    > > My task: I have bought a domain and now want to set up a website on
    > > it.

    >
    > > What will the site do: Accept a string from the user, like Google does
    > > (A very simple design). Then the site will check this string for the
    > > presence of a substring. The output will be displayed in a simple text
    > > box on the main page (to begin with).

    >
    > > If I have a script that will do this operation, I need to link the
    > > input string to this script in the background and return the result.
    > > Is CGI programming used to make this "glue" ? I could ask someone to
    > > access the script directly on my site like

    >
    > >http://www.mysite.com/myscript<params> .. but I want to separate the
    > > interface from my programs. Any advice would be greatly appreciated. I
    > > know how to code in C, C++,Awk, Bash and some more languages. Sorry if
    > > my questions seems overly naive :D.

    >
    > Perl is an excellent choice for writing CGI programs. You can't do the
    > newer "Web 2.0" with CGI, but you can still do a lot. Even if you are
    > planning to do the fancy stuff later, it is good to have a good
    > grounding in CGI.
    >
    > Consider using the Perl CGI module. It has lots of methods for
    > generating HTML and also for handling form data. It also has two
    > different types of interfaces: function calls and object-oriented
    > methods.
    >
    > Do 'perldoc CGI' at a command-line prompt to read the documentation on
    > CGI. It should be installed with most Perls. If not, you can get it
    > from CPAN <http://www.cpan.org>
    >
    > My recommendation is to use the object-oriented methods of CGI instead
    > of the functions. It provides a cleaner interface and is a good
    > introduction to OO in Perl. For generating HTML, I usually use plain
    > old print statements rather than the CGI routines, and check out "here"
    > documents. If you want to generate complex HTML pages, consider using a
    > templating system (there are several on CPAN) or a content-management
    > system.
    >
    > --
    > Jim Gibson
    >
    > Posted Via Usenet.com Premium Usenet Newsgroup Services
    > ----------------------------------------------------------
    > ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
    > ----------------------------------------------------------
    > http://www.usenet.com


    Thanks for a super-helpful answer :D
     
    newbiegalore, Feb 13, 2008
    #4
    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. Asun Friere
    Replies:
    1
    Views:
    509
    Paul Boddie
    Aug 27, 2003
  2. Peter Hansen
    Replies:
    23
    Views:
    879
    Anton Vredegoor
    Sep 5, 2003
  3. Gerrit Holl
    Replies:
    16
    Views:
    626
    Tom Plunket
    Aug 29, 2003
  4. Asun Friere
    Replies:
    0
    Views:
    483
    Asun Friere
    Aug 28, 2003
  5. Michele Simionato
    Replies:
    2
    Views:
    392
    Jacek Generowicz
    Sep 1, 2003
Loading...

Share This Page