Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
IMHO the main aim of modular programming is code reusage. It means that you put to the module any code that can be used more than once, and put to the script any code that cannot be re-used.

But TIMTOWTDI. Nobody can prevent you from writing a "Hello world" script in the way like this:

#in the file Acme/Helloworld.pm package Acme::HelloWorld; use warnings; use strict; sub new {my $class = shift; bless {}, $class } sub helloworld { print "Hello world!\n" } 1; #in the file helloworld.pl use Acme::HelloWorld; my $h = Acme::HelloWorld->new(); $h->helloworld();

And CGI::Application enforces you to do such things. There is nothing bad in such a way—the worst thing about it is that the executable file does not contain any information about what it really does :)

I don't know your certain case. IMHO if you can do different things (e.g. create different HTML pages for different projects) by modifying only 'config' lines in your script—it's good. Your script is simple enough and your module is complicated enough to fulfil your needs. If you can create only one certain page—there is nothing bad in it, as the page is finally created and from this point of view there is no difference how did you produce it.


     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

In reply to Re: When is a module too minimal? by Ieronim
in thread When is a module too minimal? by Cody Pendant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2021-06-22 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (104 votes). Check out past polls.

    Notices?