Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Not very Perlish? (note the capital P ;)

by frankus (Priest)
on Jun 10, 2002 at 10:13 UTC ( #173065=note: print w/ replies, xml ) Need Help??


in reply to Not very perlish?

As a wearer of size eleven paratrooper boots, I think elegance is over rated. As cranky Perl coder, my philostophy is this:

If it works, it's Perl.

If you still want a more Perlish way, you're throwing down the gauntlet for Perl Golf. Bad anonymous monk!.

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

--

Brother Frankus.

¤


Comment on Re: Not very Perlish? (note the capital P ;)
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://173065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2015-07-29 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls