in reply to Nested list - to reduce Codings
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"
|
|---|