Hello Tangent

Many thanks for that. I wish I'd checked back sooner to read your post. As it happens I have spent my evening working out to the same as what you have described (well nearly).

When you say 'alien style', what do you mean and could you give me an example please (unless the 'could be written as' was an example) of a non-alien approach ?

To someone who has not experienced Perl, some of the 'folded' code (or is that better worded as more concise, efficient, performant, proficient - I do not know) can make it difficult to read/understand. Therefore I like the alternative you presented in the 'could be written as' piece - that to me is much more presentable if nothing else.

I have coded in the past (not in Perl), but not to any advanced levels, so is the approach of [crudely dropping out?] 'exit-ing' from a program in a sub routine acceptable ?

Lastly, for what it is as such, are there 'better' coding approaches to achieve what is being done, or is it fairly decent technique (accepting there is no security etc)?

Thank you for taking time to respond; thank you to all - I have moved on a little and the references given to me earlier are proving enlightening, if a little challenging also - particularly one that led to a piece that touched on lexical code referencing (lambda style) coupled with OO style in relation to anonymous subs! - well I think that was what it was about :-)

Perl is *very* flexible! That would seem fair to say.


In reply to Re^2: learning by example; please explain what this code is doing? by Habs
in thread learning by example; please explain what this code is doing? by Habs

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.