And I think merlyn does it the wrong way. Besides, what merlyn does isn't automatically the right way to do it. Actually, I find much of his code written in an awful style, but I guess he'd say the same when reading my code.
Ah, then that's the point now, isn't it... there's enough difference of opinion that it's hard to say who's "right".
As for the program logic you describe at the end of your post, I've seen real good, and very stylish programs like this:
Yeah, so have I... I really like the block enclosure style, but now we're not talking about subs anymore. The flow of the program is still linear in your example, and is perfectly fine in my book. When you intersperse subroutines in with logic then your program execution stops being linear and becomes non-linear, meaning you're bouncing around all over the place trying to read the dang thing. Not good. And if you're going to bundle your subs with location of use, and wrap the whole thing in a closure, you probably ought to be changing packages, too. ;-D

Gary Blackburn
Trained Killer


In reply to Re: Re: Re: Re: Re: Re: where do you put your subs by Trimbach
in thread where do you put your subs by greenFox

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.