Juerd wrote:


Fagyal Csongor skribis 2006-09-20 15:43 (+0200):
Inefficient was probably a bad choice of word.
I would rather say: I would not like to see Perl6's CGI.pm as a monster module, which has one part everyone uses, and one hundred other parts that some uses, because I feel those parts should be put into other modules.
Perl 6's Web toolkit, even with all these classes, is likely to be much
lighter than Perl 5's CGI.pm with :standard.
I guess that's one of the reasons we are heading from 5 to 6 :)

But note that especially if it is a well designed bundle of
classes/roles, you can pick exactly those things that you need, and
leave all others out. That's part of the reason why you should separate
And here is another reason :)


If we talk about nicely structured OO, I can see a few ways:
- CGI.pm include something like "CGI::HTML", to get rid of the HTML generating part, or maybe even separating CGI::HTML and CGI::Request

s:g/CGI/Web/, please! mod_perl has nothing to do with CGI (except
perhaps for its compatibility syntax), and neither does HTTP::Daemon. We
should write generic code, suitable for any implementation.

I'm thinking of:

   Web::Init::CGI      # Initializer for CGI requests
   Web::Init::FastCGI  # Initializer for FastCGI requests
   Web::Init::ModPerl  # Initializer for ModPerl requests
   Web::Request        # Request objects
   Web::Response       # Response objects
   Web::Session        # Session objects
   Web::HTML           # HTML generation
   Web::Util           # HTML-entities, URI-encoding, etc
   Web                 # utility module that mostly loads other modules

A very sound idea. Reorganising the CPAN namespace :) (This CGI/HTTP/LWP/HTML/etc. got a bit confusing as it grew.)

I would say, maybe add "Web::Tools::*" so that others can add various useful (and not that useful) modules without mixing up everything.

And maybe expand Web::HTML something like:
But that's might as well be too much.

So is Web::Init::* class supposed to be selected by Web, and Web::Init(::*) used by e.g. Web::Request & Web::Response, so it all becomes transparent?

Yes. I'm talking about a web development toolkit, that does at least
what CGI.pm did, and not about CGI as a namespace, because I think
that's an incredibly bad thing anyway.
I absolutely agree.

- Fagzal

Reply via email to