Who is supposed to learn from this exercise? What are they supposed to learn? You've got a bitwise XOR seeding srand, rand, regular expressions, and the infrequently used int. At the same time, the surrounding code is blatantly obtuse: my declarations in the operations that use them, a braindead for loop, an even worse foreach, reuse of variable names. I mean, you've got high-level constructs surrounded by horrifically poor code. If this test is intended for someone relatively new to Perl, there is no way they are going to find some minor error in your code, because they're going to be too busy wondering what ^ means and what the difference is between / / and / */! On the other hand, if you're looking at a mid- to upper-midlevel Perl coder who actually knows what those things do, you're wasting their time having them wade through garbage that they ought to be smart enough not to write in the first place.

Seriously, if you want someone to learn Perl, focus on proper use of the language, such as making smart choices regarding control statements and data types given certain needs. Save the tricks for entertainment purposes, because all the learner is going to get out of it is a feeling of bewilderment, but that is not the point of instruction.


In reply to Re: Re: Re: Simple array sorting by djantzen
in thread Simple array sorting by FireBird34

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.