Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Possible to refer to variable defined later in script?

by sundialsvc4 (Monsignor)
on Nov 13, 2012 at 01:07 UTC ( #1003533=note: print w/ replies, xml ) Need Help??


in reply to Possible to refer to variable defined later in script?

There are, IMHO, “a whole bunch of extremely good reasons why” it is best:   (a) to determine what you want to generate before you generate it; and (b) to use a templating tool to actually generate the HTML or anything-else.

One of these reasons is “separation of concerns.”   If you do it “the other way,” the day will come when someone wants you to make some page-output change, e.g. so that the page looks noticeably-different in a particular case ... and, perhaps obviously (if you’re very lucky) but perhaps quite subtly, the answers start coming out wrong.   And the logic by that time is so danged jumbled-up that you wish you could rewrite it but in the meantime that you didn’t have to touch it.


Comment on Re: Possible to refer to variable defined later in script?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003533]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2014-07-28 11:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (196 votes), past polls