Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Beginnings of Online CGI Course

by Ovid (Cardinal)
on Oct 06, 2000 at 07:50 UTC ( #35535=monkdiscuss: print w/replies, xml ) Need Help??

Well, I've finally found some free time (read: I got off my butt) and started writing the online Web programming course that I've mentioned before. I only have the Introduction and Lesson One up, but before I write any more, I'd appreciate feedback from my fellow monks.


  • Bad code
  • Speeling errors :)
  • Readability
  • Accuracy
  • Broken links (the link for Appendix One is broken. I'll get to it eventually)
If you read through it, you'll notice a lot of links to Perl Monks. Who knows? If it's popular enough, it might drive more people to the site.

The course is free and I intend to keep it that way. However, if some publisher out there wants me to write a book, well, that's another story :)

You can find the course here. You can post comments to this node or e-mail me.


If some Monks want to volunteer to write a chapter or two, let me know!

Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

Replies are listed 'Best First'.
RE: Beginnings of Online CGI Course
by Dogg (Scribe) on Oct 06, 2000 at 17:10 UTC
    I thought it was great. I think an online CGI course people can trust is a great idea and so far, yours seems really readable and helpful.

    Just two minor things I found:
    In the Use CGI section in the 3rd paragraph you use 'here' and probably meant the homophone 'hear'.
    And I got a font change in the my $query=new CGI section after the 'write sub header {}'. The font in my browser (NN 4.73, MacOS 9) went from sans serif to a serif font for the rest of the page.

    Again, I thought it was great and I'm looking forward to more.
      I've made the change from "here" to "hear". Ouch. I hate it when I screw that one up! Thanks for pointing it out.

      Thanks to ar0n for catching the problem that probably caused the font change. My HTML was <t>sub header{}</tt>. I've fixed that and a couple of things that tilly pointed out.

      For anyone who reads it, feel free to be as picky as you want. I want this thing to be as solid as possible.


      Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

I hate HTML functions
by swiftone (Curate) on Oct 06, 2000 at 22:29 UTC
    • Bad code
    • Speeling errors :)
    • Readability
    • Accuracy
    • Broken links (the link for Appendix One is broken. I'll get to it eventually)
    All good. My one complaint is the use of the html functions. I, personally, find those less readable, and often counter-productive (I don't like mixing content and code so tightly).

    I know it's a personal preference, but I thought I'd throw it out there. Otherwise everything looks great. I like the emphasis on good practices early on. Will you be introducing CGI::Carp?

      First, I do plan to introduce CGI::Carp.

      I recommend that the people take the course learn to use the HTML functions for several reasons:

      • If they work on anyone else's CGI scripts, they are likely to encounter them sooner or later, so they should know them.
      • Because is creating your HTML for you, it provides a rough syntax check of the HTML. You can't get that with a here doc or with HTML::Template.
      • You can't forget to close your tags (why, just today I fixed a table that someone forgot the closing table tag. Too bad for Netscape).
      • It's tough for them to decide if they like these functions if they never use them.
      I plan to introduce a variety of methods of creating the HTML, so that people taking the course can see the pros and cons of different methods (TIMTOWTDI). It's tough to evaluate something you have never used. I hate multiple print statements and a here document is not much better. Obviously, for large sites, mixing code and HTML is a nightmare. At the very least, the HTML functions are code as opposed to markup tags. I won't demand that the people taking the course use any one method, but I will ask that they at least be familiar with them.


      Join the Perlmonks Setiathome Group or just go the the link and check out our stats.

        The HTML functions also permit me to use Emacs to find the nestingness of each tag, and there are a lot of high-level functions that aren't 1-to-1 with HTML that shortcut many things. When's the last time you had to do an option-list by hand? It's so much easier with the shortcut! And using the HTML functions, I get sticky fields and HTML-escaping of defaults for free!

        -- Randal L. Schwartz, Perl hacker

RE: Beginnings of Online CGI Course
by Adam (Vicar) on Oct 06, 2000 at 21:58 UTC
    I don't know the answer to this, but I have heard from various sources that:
    my $query = CGI->new();
    is preferable to
    my $query = new CGI;
    I'm a bit curious as to why that would be preferable, so I open that topic up for discussion. If a good reason for it is revealed, Ovid, you might want to do it that way in your course. Of course, in the spirit of TIMTOWTDI, you could decide you like it the way you have it, and leave it that way.

    Personally I always use the arrow method, but I don't know which one is "right".

      new CGI is easily misunderstood. Some even suggest that you should write CGI::->new() to prevent CGI->new() being interpretted as main::CGI()->new(), which is possible. I'm not completely decided on that last point because I don't think it is supported in moderately old versions of Perl and I feel that I can usually avoid having functions that have the same name as modules that I use. I will probably convert to CGI::->new() before too long, though.

      So let's consider:

      my $q= new CGI;
      What if you do this from a package? You probably have a new() method of your own and now you've (probably) done:
      my $q= new( "CGI" );
      I think there are also gotchas with regard to confusing precedence, but I don't recall them.

      So many (including me) suggest that you always avoid "indirect object" notation. This might also apply to the standard:

      print HANDLE "Stuff\n";
      which should instead be written:
      HANDLE->print( "Stuff\n" );
      but I've not seen that point pushed much. I personally think that things will slowly migrate that direction, though.

              - tye (but my friends call me "Tye")
RE: Beginnings of Online CGI Course
by Albannach (Monsignor) on Oct 06, 2000 at 19:01 UTC
    I had a quick look and like the feel of it. I'm looking forward to the rest as my knowledge in this area is, umm, next to squat!

    Here are some booboos and comments for your consideration:
    - your mailto link near the bottom of the intro page is "@easystreet,com"
    - unnecessary comma near the top of Lesson 1 in "examples, of the scripts"
    - you might eventually add a glossary given that you are not requiring detailed Perl knowledge (e.g. I'm not sure "shebang" will be too well known in the non-UN*X crowd, and you could take the pragma definition out of the text)
    - spelling: "Excercises" at bottom of Lesson 1 and elsewhere
    - you didn't put "Perl is not CGI" in huge flashing bold red letters (grin)!

    Thanks for the effort you're putting in on this!

RE: Beginnings of Online CGI Course
by ColonelPanic (Friar) on Oct 07, 2000 at 19:34 UTC
    I read chapter one of your course and it seems good so far. However, my one concern is that all of us here know what you are talking about, but would a beginner be able to understand it? As a relative newcomer to CGI programming, I am not sure that I would have understood all that when I was starting out. Specifically, I think many beginners need a lot more information about how to get a script running, where it goes on the server, how it is called from a web page, and so on. I realize this may be covered in the appendiz, but it might be better suited as a chapter, or maybe combined with some of chapter one. Aside from that, it was relevant and easy to understand.
RE: Beginnings of Online CGI Course
by vaevictus (Pilgrim) on Oct 09, 2000 at 19:58 UTC
    found an uncoupled ")" character in the definition for use strict 'vars' ...
RE: Beginnings of Online CGI Course
by monk2b (Pilgrim) on Oct 09, 2000 at 22:21 UTC
    I read the 1st chapter of your coarse too. I know more about html than I do about perl,so this coarse is just right for me.The only way I know of to help you ,is to read the coarse as you add to it and let you know if I find the material informative or not.
    So far so good!


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://35535]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2022-06-26 02:11 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (83 votes). Check out past polls.