Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

*.pm vs. *::Simple

by Zecho (Hermit)
on Oct 22, 2001 at 17:43 UTC ( #120517=perlquestion: print w/replies, xml ) Need Help??

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

(substitute CGI for any module with a ::Simple counterpart)
Can someone explain the differences in XXX::Simple etc, Say for instance, Is CGI::Simple, a smaller subset of the same usage terms? Could it be looked at as: CGI::Simple is the basic structure, with being the complete unabridged and expanded compilation? I know html rather well I think (having used it for a number of years) and using CGI would seem to make some things easier for me, but I am right smack in the middle of learning perl, and now EZDBI (for a current project). From what I have gathered, CGI::Simple is quite easy to understand and use. Am I wrong in assuming this? How confused am I going to get trying to add another something to the list of things I'm already attempting to commit to memory? And what are the pros/cons of vs. CGI::Simple ?

Replies are listed 'Best First'.
Re: *.pm vs. *::Simple
by davorg (Chancellor) on Oct 22, 2001 at 17:54 UTC

    Well, having just searched CPAN, I can't find any reference to a module called CGI::Simple. That would seem to me to be one good reason for not using it.

    The CGI module can be a simple or as complex as you want it to be, and I think it would be a shame to invest time learning CGI::Simple and then eventually find that it doesn't do something that you need. You'd then have to start again, learning how to use CGI.

    Another advantage with is that is a part of the standard Perl distribution, so you can guarantee that you'll find it installed everywhere.

    All in all, I can't think of any good reason to use any module in preference to


    "The first rule of Perl club is you don't talk about Perl club."

Re: *.pm vs. *::Simple
by tachyon (Chancellor) on Oct 22, 2001 at 18:15 UTC is a big module. It does a lot. It is part of the standard distro. It is well tested. It is well documented. It will do more than you want. Does this make it

    >>> bloated? <<<

    Perhaps technically yes but in that case all modules/libraries are bloated. Does it only load the code that you use via a custom implementation of self loader - more or less yes. Will you see any practical speed benefit using anything else - probably not. don't leave home without it.


    PS some of the other offerings on CPAN are good. Some are not. Last time I bothered to mention this to one of the authors of a rather bad module I did not get a reply. In contrast Lincoln Stein, who mostly wrote, will likely reply within hours if you have a problem. Admittedly he is likely to explain that the module is fine and it is your code that sucks but that is because is so well tested ;-)



      The bloat wouldn't bother me as much if it was relevant to the Common Gateway Interface, but no, it's mostly HTML related.

      The extra HTML functions should probably go into another module called something like HTML::OO, HTML::Funk or HTML::whatever. Or you can be really sneaky and put it in CGI::HTML.

      If not, then when will we see XML,WML related code bloat even more ?

Re: *.pm vs. *::Simple
by chromatic (Archbishop) on Oct 22, 2001 at 20:06 UTC
    Unofficial (almost unwritten) CPAN convention explains them as:
    ::Simple Simple/basic interfaces to more complex modules ::Lite Lightweight implementations of protocols etc
    There's some overlap here. (Some people think SOAP::Lite should rather be SOAP::Simple.)
Re: *.pm vs. *::Simple
by thinker (Parson) on Oct 22, 2001 at 18:28 UTC
    Hi Zecho,

    The only module I can find on my machine with a ::Simple counterpart is LWP, which has LWP::Simple.

    Here is the explaination that the author of that module gives.


    This interface is intended for those who want a simplified view of the libwww-perl library. It should also be suitable for one-liners. If you need more control or access to the header fields in the requests sent and responses received you should use the full object oriented interface provided by the LWP::UserAgent module.

    I guess what this means is that Module::Simple presents, what is in the opinion of the author, a simple interface to his/her module


Re: *.pm vs. *::Simple
by thunders (Priest) on Oct 22, 2001 at 18:45 UTC
    Another misconception that needs to be addressed is that does not necessarily have very much to do with Thing::OtherThing or Thing::Simple or Thing::Whatever in each of those cases you have a module called or or in a folder called "/Thing". These modules may or may not require you to have installed. I don't see CGI::Simple in my standard distribution, so I doubt that it is supported by the creator of My best advice to you is to read the documentation for and for CGI::Simple, and use whichever makes sense to you.
Re: *.pm vs. *::Simple
by jmcnamara (Monsignor) on Oct 23, 2001 at 04:06 UTC

    I think that the authors of the ::Simple modules deserve some credit for identifying the core functionality of a module and concentrating on that. They deserve real credit if they manage to "keep it simple".

    For example, over two years ago I was developing an Excel library in C when I came across a simple hack to generate minimal Excel binary files with very little code. At the time I was using Perl to generate CSV file for importation into Excel and thought that I could try to produce a binary file instead. To my surprise it worked out very well: mainly due to, my now beloved, pack() function.

    I posted the code to comp.lang.perl.modules in response to a question. It was about 200 lines of code and comments. After that I rolled it into a module and posted it to CPAN as Spreadsheet::WriteExcel. It was about 600 lines including POD. And it was very simple: it wrote text and numbers to a single worksheet in an Excel workbook. This was all that I needed it to do and I was quite happy with it.

    After a while people started to write to me and say that it would be nice to have multiple worksheets. From my past experience with the C library I knew that it would be difficult to create a cross-platform solution without the appropriate Windows libraries. However, I hacked away at it and after 3 months I had a solution.

    After that I received a steady stream of requests to add formatting, hyperlinks, formulae, functions, page setup and images. So I included those as well and now, almost two years later, Spreadsheet::WriteExcel is over 7000 lines of code, is comprised of 10 modules, uses Parse::RecDescent, uses pack() 300 times and has over 40 pages of documentation.

    But what prompts me to write this is that recently a Spreadsheet::WriteExcel::Simple module was uploaded to CPAN. It subclasses Spreadsheet::WriteExcel to provide more or less the functionality of the first version that I wrote. When I spoke to the author, Tony Bowden, about it he said that it was inspired by a client who just couldn't deal with Spreadsheet::WriteExcel.

    In many ways it would have been nice to have called it a day after the first 200 line version and lay claim to the clarity and resolve of the ::Simple authors. Because, even if peoples expectations aren't simple, code can be.

Re: *.pm vs. *::Simple
by demerphq (Chancellor) on Oct 22, 2001 at 17:48 UTC
    Good question. Ive wondered the same thing too. Hopefully a guru will step in and explain a bit. The HTML and CGI and CGI3 and cousins are a large and confusing bunchof modules without direction as to where to start.

    Thanks for asking Zecho.

    You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)

Re: *.pm vs. *::Simple
by rrwo (Friar) on Nov 08, 2001 at 09:44 UTC could mean many things:

    • A simpler way of doing XXX, but not necessarily the same way of doing it that does, or with all of the functionality of;
    • A simpler interface to, not necessarily with all of the functionality;
    • A simple implementation of XXX, where they may not even be an;

    Or combinations of the above.

    Simply put: a *::Simple module is either a simpler interface, or it does something simply.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2021-04-14 23:15 GMT
Find Nodes?
    Voting Booth?

    No recent polls found