One post - replies to several good brethren and sisthren.

>Re: Not very Perlish? (note the capital P ;) - Noted!

>If it works, it's Perl. - True - but I wish to extend my knowledge

> you're throwing down the gauntlet for Perl Golf. - Que? "Perl Golf"?

my @items = map {$_ % 100 } @_; my $sum = 100; $sum -= $_ for @items[0..2]; $items[ $sum<0?0:2 ] += $sum unless $sum == 0;

Neat! i *think* I understand this.

Brother Frankus. - Thankyou.


Here's a Perl program that takes N numbers and scales them such that their sum becomes 100, but their ratios remain the same.

- Probably what I was unconciously seeking.

Abigail - Thankyou. This is what I will be using!


~Particle *accelerates* - I need to sanitise all inputs and continue to run. - probably an easy mod IF I understood how yours worked :)


Not sure why we're doing a modulo 100 operation here unless it's a substitution for the int() operator.

Seemed like the easy way to
a) force values <100
b) deal with non-integer inputs?

--t. alex - Thankyou.


> I think you have an excellent start - Is this "faint praise" ? :)

>. You can simplify it a fair bit, however: - And in a couple of (now you pointed them out!) very obvious ways.

- tye (but my friends call me "Tye") - Thanyou! (May I call you Tye?:)


When is P the compliment of ch?
When they are in the company of Erlish!


In reply to Re: Not very perlish? by Anonymous Monk
in thread Not very perlish? by Anonymous Monk

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.