Hi Aakikce. What is it your program is supposed to do?

I am guessing what you are doing is developing a mini scripting language that translates pseudo-html to html. I can see the value of that. It's a very nifty project. You could learn a lot doing this.

If you are trying to create something of actual use (for production, for others to use)- this is a dead pursuit- unless you are some wizard programmer with some master angle.

Please look at : CGI, creating standard html elements . When I started playing with perl I would do things like code my own super duper "div" sub that would take funny arguments to make a javascript collapse expand block, or style a million ways etc etc. I would create my own "form" sub to output a form a certain way to the screen. It would take a paper to explain why one would use CGI.. so.. Ovid's CGI course lesson two, why use CGI.pm

A module perhaps best suited to these thigs.. may be HTML::Template.. which at first may seem fruity or needlessly simple ( i had the ignorant impression at first that It was so simple I could just just 'roll my own' in fifteen minutes. (please..)) - has been one of the most powerful tools in my arsenal to separate content from presentation.

If you take the small pain to learn to use existing tools in perl, that is..the code and modules so lovingly donated by the community to the community.. (aka things written by people who know better then we do but will spend only so much energy pushing us in the right direction)- then you will be much better off and your projects will grow by leaps and bounds, and be based on the solid (hopefuly) work of your forefathers.

Why CGI, why HTML::Template.. To separate content from presentation. To separate as much as possible .. code from design and content.

Also look up POD to html on cpan.org - and test to html, also look it up here on perlmonks. You'll find great stuff and amazing solutions that other people found.

I think the thing you're going to hear a lot from perlmonks is that the question you pose - what you are trying to do, creates a lot of problems and achieves little. It is as if you are asking "i want to get my lamborghini diablo to give me 40mpg, any ideas how i can do that?". Or.. My pet ants refuse to mingle with my praying mantis, how can I therefore keep both pets , mayhbe even make them get along? - Most people would say separate them into different containers, if they are in the same. it is a tried and true solution. but.. Do not be discouraged. If you can figure out how to have both ants and mantid get along in the same container.. you're on to something. Chances are it won't work. But you will learn tons.

I think it was maybe brian d foy (?) that said "a professional programmer is one who has made all the mistakes"


In reply to Re: Nested list - to reduce Codings by leocharre
in thread Nested list - to reduce Codings by aakikce

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.