Apparently, I'm the only one who ever needs scores of variables passed into a single subroutine

No, you are certainly not the only one...
I recall writing a sub that took 20-odd parameters. It quickly got out of hand. At that time, I didn't know how to do it any other way.

If I have a sub that takes more than two required parameters and one optional parameter, I would use a hashref instead so I could pass a series of unordered, named parameters. However, if I got to that point, I would seriously question whether I had created a suboptimal fudge instead of a good design.

The one time I have recently wanted to pass many parameters to a sub was the components of an email (from name, email, recipient name, etc). I created a sub that accepted a hashref and then encapsulated the sub in a module so the functionality was clearly separate from the main code.

If you are writing subs that take lots of parameters, I suggest you ask yourself if there is a better way to do it. The answer, in any language, is probably yes.


In reply to Re^2: Ordering of parameters - Re^9: Converting Unicode by Bod
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.