johnny0723 has asked for the wisdom of the Perl Monks concerning the following question:

I've been asked to work on a project and I must use for this project. I've never heard of this and never used it. Not sure what it does and how to use it in my programs. I'm pretty new to Perl and have not had formal training. Just been reading the llama book. Any help is appreciated. -John
  • Comment on What is and how do I use it?

Replies are listed 'Best First'.
Re: What is and how do I use it?
by friedo (Prior) on Oct 28, 2005 at 21:17 UTC
    What is

    It's an old Perl library for writing CGI programs.

    and how do I use it?

    DON'T! is horribly outdated and contains some serious security problems and is not fully compliant with the CGI spec. The best way to write CGI programs is to use the CGI module. If you must work on existing code which uses, the CGI module has a compatibility mode that will make it pretty easy to update the existing code.

Re: What is and how do I use it?
by kwaping (Priest) on Oct 28, 2005 at 21:16 UTC
    It's a library of subroutines that are helpful for processing CGI requests. You can find it on the cgi-lib homepage (note that the homepage is copyright 1998).

    Personally, I'd try to convince your employers to use instead.
Re: What is and how do I use it?
by ww (Archbishop) on Oct 28, 2005 at 21:34 UTC


    if you are truly "required" to use for other than for academic purposes, you should be aware that, in the words of "(it has) largely been superseded by -- a much larger object oriented cgi processing module." You can readily obtain that current standard for free from CPAN or from a vendor of windows implementations such as Active State.

    Security is one of the considerations. If an employer is requiring use of, you should probably protect yourself and the employer by warning of the potential for problems.

    If you must use because of academic requirements, the file itself contains useful explanatory material; simply open it with your editor. You can find much additional material on both the issues and it's use, by SEARCHing here (which turns up nodes such as and by googling the filename. (Oddly, and perhaps owing to caffeine deficiency or the lateness of the hour, I found no pod in the copy I retain -- for no really good reason -- but generally, pods are useful resources.)

    welcome to perl and to the monastery...

Re: What is and how do I use it?
by Zed_Lopez (Chaplain) on Oct 28, 2005 at 21:22 UTC is of historical interest as the best we had before we had CGI, which has been one of the Perl core modules since Perl 5.004 in May 1997.

    Unless you have some godawful dependency on using Perl 4, it's hard to think of a reason to use cgi-lib instead of CGI.

Re: What is and how do I use it?
by bassplayer (Monsignor) on Oct 30, 2005 at 04:56 UTC
    From personal experience, I urge you to please follow the advice of our fellow monks and convince your client that should use If you cannot sway them, then turn around, run like hell and don't look back. No, seriously. :-)


      Hi Everyone, thanks for the feedback. It really sounds like is what I should be using. However, let me provide some more details of my task, and perhaps it will make more sense. 1. Build an array of files in a directory 2. print the array of files 3. modify the print so it displays links to them 4. Modify this cgi program so it allows parameters to be passed and displayed. This is apparently where I must use I went to the home page of and from the example I saw there, I figured that is a library with a bunch of sub routines that can help me get input. Sorry for such elementary questions. I'm new to programming and perl. Is there a book besides the llama that you guys can recommend for a beginner? Thanks a bunch! John

        Is this homework? It reads like homework. We don't really like helping people with homework. will do all that you need. And probably easier than you would do it with

        As for a book, Beginning Perl is available online and it includes an Introduction to CGI.


        "The first rule of Perl club is you do not talk about Perl club."
        -- Chip Salzenberg