why do we use module in perl
Lots and lots of reasons, here are two of the main advantages:
- Faster development time, a lot of code is already written for you.
- Many modules have been extensively tested and are, in all probabilty, more solid than code you would write yourself.
Does the using of module help to increase the loading speed of the page?
You sound a bit confused here. Modules can be used for much more than just HTML generation. For HTML generation though, using a template system will definately make your code a lot cleaner, more maintainable, and faster to develop than printing HTML will a bunch of heredocs and loops. On the other hand, I'm not a big fan of using CGI.pm's generation methods and would almost prefer a mess of heredocs to them :).
You might also want to take a look at UTFM - Use the Friendly Modules and/or do a super search on the subject.
Update: As for templating systems, check out HTML::Template and jeffa's excellent tutorial on the subject.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.