Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Damn! I did this one without reading a single other post and came out with a sloppier version that yours, but along the same lines (I'm new at this :)
sub find_avg { (eval join"+",@{$_[0]})/(($#{$_[0]})+1); }
I had a hell of a time getting $#array working with $_[0]. I see I over complicated it :)
I'd like to add that these "Junkyard" puzzles, Golf and such are extremely good practice for those of us lower on the curve. Just in the past week or so, I've added quite a bit of knowledge to my base. These remind me much of doing geometric proofs back in middle school. Entertaining as well as educational.

Thank you.


In reply to Re: Re: "Junkyard" Puzzle: Average of Numbers by mr.nick
in thread "Junkyard" Puzzle: Average of Numbers by Masem

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [Your Mother]: Cumin? Now I want tacos...
    [Eily]: there should be an option in grep for fuzzy order of the letters in the pattern
    [Eily]: as in "I might have inverted two, but my eyes misread in the some order as my fingers mistype"
    [LanX]: can't find a definition for the sound
    [LanX]: Voiceless_palatal_ fricative
    [Eily]: Lanx https://en. wikipedia.org/ wiki/Voiceless_pal atal_fricative
    Eily got the Cowboy message
    [Your Mother]: I prefer palatial fricatives.

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (16)
    As of 2017-03-27 17:02 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Should Pluto Get Its Planethood Back?



      Results (320 votes). Check out past polls.