Hi johnrock47, what have you tried here? Is this just homework? I'll provide a solution based on my local machine's arp table (as you haven't supplied the config file on the server you mentioned), but I doubt it's homework worthy... show what attempt you've made and you'll get better help:

arp -a | perl -MData::Dump -anE '$F[1]=~s/(?:\)|\()//g;$h{$F[1]}=$F[3] +}{dd\%h' { "172.31.219.36" => "00:ae:da:23:85:d0", "192.168.1.1" => "48:f8:b3:3c:30:33", "192.168.1.115" => "70:77:81:43:ae:ab", "192.168.1.138" => "84:38:38:9b:61:64", "192.168.1.140" => "00:ac:1a:61:0e:66", "192.168.1.143" => "<incomplete>", "192.168.1.4" => "<incomplete>", }

You've been here since October... How do I post a question effectively?

update: I tried to golf it a bit more, but I couldn't figure out how to put the substitution within the assignment to the hash. Without a lot of time to test, it appeared as though the expression was returning match count perhaps, instead of result. Can anyone tell me how to get the result returned in such a case?


In reply to Re: challenge on perl by stevieb
in thread Reaped: challenge on perl by NodeReaper

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.