Thread: CGI.pm Basics

    #1
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    functions


    How about including a list of functions, Or perhaps a link
  2. #2
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    hola cgi


    quiero aprender cgi
  4. #3
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: functions


    http://stein.cshl.org/WWW/software/CGI/
    <br>
    <br>
    This is the documentation by the author of CGI.pm, Lincoln Stein, he also wrote a book on his module called "Official Guide to Programming with CGI.pm" ... Hope this helps.
  6. #4
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: functions


    from any command line (unix) you can get more info by using the wonderful perldoc function

    ie:

    [mrnatural chris]$perldoc CGI

  8. #5
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Hmmm.....


    Typically I am not a MS fan but Front Page 97, 98 and 2000 all provide this functionality with a little copy paste action. Build your object in a GUI and copy the HTML into your "favorite text editor." I have been using extensively with DBI and Mysql DBD. Just choose the chunk of HTML that you want to loop and that is about the only time you will type "print". Just use:

    print <<ENDHTML;


    ENDHTML

    to wrap you FP HTML and all is good.

    "a Perl script is correct if it's halfway readable and gets the job done before your boss fires you." --Larry Wall

  10. #6
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Crappy Print Version of the Article


    When you print out the article, the white type on the gray background is ommitted - duh guys!
  12. #7
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Useful Intro


    I found this very useful introduction to CGI.pm. I was looking all over the web for a very simple intro, and this was perfect. I think I now have enough information to get my feet wet.

    Thanks............
  14. #8
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    CGI vs CGI.pm


    Comming from a programmers point of view... already familiar with programming language and syntax... this all must make sense and probably helps to transform cumbersome HTML into a more familiar package.

    However from the point of view of someone who has struggled to learn basic HTML and has built a few personal homepages in HTML and otherwise knows nothing about programming languagees, syntax etc. it seems unduely complicated and redundant.

    typing:

    Code:
    print "<html><head><title> MY PAGE </title></head><body>\n";
    seems relatively straightforward and familiar to. I've done it a hundred times.

    Now I need to forget what I already know and learn to write:

    Code:
    use CGI qw(:standard);
    or maybe:
    Code:
    use CGI qw(:all);
    and:
    Code:
    print header(); 
    print start_html(-title=>'MY PAGE');
    which is fine... but completely unfamiliar and incomprehensible in terms of standard HTML
    also what is the point of using:
    Code:
    print br(), hr();
    rather than
    Code:
    print "<br><hr>";
    and
    Code:
    print end_html();
    does't even save a keystroke over:
    Code:
    print "</html>";
    why learn to use a code that you don't know just to generate a code that you already DO know when you can just use the cade that you already know in the first place?

    I'm sure from the top down this makes sense... but from the bottom up it seems rather redundant.

    If I alreay have a website with the HTML written out I can just paste the familiar HTML code into the CGI script to create a new CGI generated page that looks identical to my old HTML website... but If I have to covert to CGI.pm it seems I have to completely relearn and rewrite every inch of every line of code from scratch.

    It seems something like trying to study Greek so I can use Greek "shorthand" to translate the Greek back into English.

    That is probobly a good thing to learn Greek Shorthand(CGI.pm) for translating Greek(CGI) into English(HTML) if you already know Greek... but not such a good thing if you only know English.
  16. #9
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    CGI.pm Basics


    CGI.pm Basics I learned more about CGI.pm in these brief tutorials then I have using the book The Official Guide to Programming with CGI.pm what a waste of money that was.
    Thanks,
    Paul You can read the article here .
  18. #10
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    image help?


    Hi: I'm running SuSE7.1, Konqueror, and Apache-1.3.14. The cgi script for uploading picture_file prints out binary code for the image. What needs to be added to print image? I can create a perl code script, run it from cgi-bin, and print out image, if I add print "Content-type: image/PNG\n\n"; at the top of my script. Is there something similar in CGI.pm? Thanks, Tom
  20. #11
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: image help?


    Yes, just type:

    print header(-type => "image/png");

    You can do this with any Content-Type you want too. =)
  22. #12
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    cgi.pm


    Excellent tutorial on cgi.pm. It was just what I was looking for! I downloaded the pdf file to keep the tutorial handy on my computer. Looking forward to the next installment
    Paul :)
  24. #13
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Thanks


    This site is awesome for someone without the funds to go buy lots of books. I/We appreciate it.
  26. #14
  27. No Profile Picture
    Ducani
    Guest
    Devshed Newbie (0 - 499 posts)

    CGI.pm Basics


    CGI.pm Basics

    November 13, 2000 - Tired of writing Perl code to parse form data? Take a leaf from the book of the experts and let CGI.pm do all the work for you. This article introduces you to CGI.pm's powerful page construction and form parsing capabilities, with simple examples of how you can use it to simplify your Perl development. Click for full article.

    Please discuss this article in this thread. You can read the article here .

IMN logo majestic logo threadwatch logo seochat tools logo