The gotos and lack of return statements and in fact the general coding style strongly suggest to me that it was transliterated from (bad) VB, by a not very experienced VB or Perl programmer. (I might have said Pascal but using gotos is not Pascal)

The whole assign to $_[0] as a return is strongly reminiscent of the VB concept of assigning to the function name for setting a functions return value, likewise VB (pre dotNet anyway) doesnt have a return statement, and normally relies on goto on err type logic for exception handling. Both routines have all of these characteristics.

BTW, many of these issues are older design concepts that have long since been rejected as being generally bad ideas. Using the function name as a pseudo variable makes recursive calls a bit tricky to deal with, and long ago it was realized that the Pascal-esq single-point-of-entry, single-point-of-exit philosophy just created more problems than it solved (despite being an excellent way to teach disciplined programming, all you bottom sub'ers would get killed by Pascal). Relaxing it to Single-point-of-entry, multiple-points-of-exit (as perl does) makes for a much more "natural" feel, and avoids a whole host of bogosity, like the loop and a half problem, and avoids silly programming habits, some of which are well demonstrated in your WTF code.

---
$world=~s/war/peace/g


In reply to Re: Paid for crap by demerphq
in thread Paid for crap by holli

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.