Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

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.


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

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2021-06-20 01:05 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (93 votes). Check out past polls.