Any time I go beyond 5 parameters I make it into an object. That's all objects are really: a collection of named pieces of data, along with the functions that operate on them. Then, the attribute accessors help you avoid typos. If you know the names of all the variables upfront, then an object (or collection of objects) are the way to go. If the variables are dynamic, then yes just pass them around as a hashref. Or, do some clever hybrid of the two ideas if you have a special use case.

Raku does in fact solve many of the pain points of Perl 5. That's its reason for existing. The reason many Perl 5 people did not jump on board was simply because of performance, and that it doesn't really carry forward the ecosystem of existing perl 5 modules. (Raku can use Perl 5 modules, but they are slower than native raku code, so that kind of implies that every existing module ecosystem ought to get rewritten into Raku) Also, many of us are perfectly satisfied with the tools we have available, and the minor feature gains don't justify the migration cost.

If you want to solve your problems with Raku, then more power to you! If you are genuinely wondering why this crowd is satisfied with the features and warts of Perl 5 when it comes to problems like yours, then maybe you should make a large semi-anonymized example as a new post and ask "how would you solve this"? ...and then take the answers as a thing to study, instead of attack. I, for one, am using Perl 5 because I have not yet found a problem that it couldn't handle well, and it gives me the choice to solve the problem extremely quickly (toss hashrefs around) or very properly (object hierarchy and type libraries) or very performantly (using XS or Inline::CPP) or any combination I want within that triangle. I've tried many other languages and none have provided that versatility.

(technically I'm cheating by using C, because that's a second language. but it integrates very nicely with Perl)

Edit:

Any time I go beyond 5 parameters...
A lie. As I concluded, sometimes I play fast and loose, and other times I aim for more structure. It should read: "Any time I go beyond 5 parameters I think to myself that I should probably be using an object, and consider which of these parameters would make the most sense as an object, or whether they should get included as attributes in the current object, and whether I want to spend that much time refactoring".

In reply to Re^2: Ordering of parameters - Re^9: Converting Unicode by NERDVANA
in thread Converting Unicode by BernieC

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.