Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Reaped: challenge on perl

by NodeReaper (Curate)
on Dec 02, 2015 at 01:43 UTC ( [id://1149098]=perlquestion: print w/replies, xml ) Need Help??

NodeReaper has asked for the wisdom of the Perl Monks concerning the following question:

This node was taken out by the NodeReaper on Dec 02, 2015 at 05:35 UTC

Replies are listed 'Best First'.
Re: challenge on johnrock47
by Anonymous Monk on Dec 02, 2015 at 02:46 UTC
Re: challenge on perl
by james28909 (Deacon) on Dec 02, 2015 at 03:42 UTC
    Me detects homework that is cleverly disguised as "challenges".
Re: challenge on perl
by stevieb (Canon) on Dec 02, 2015 at 02:02 UTC

    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?

      ... -anE ...

      Hi stevieb, -lansE

        I saw something by choroba today on SO about -s... I'll do some research on what you've posted. Thanks!

      Hi stevieb this is exactly my setup for ip and mac addresses but lets say the file is in my home directory do i need to open the file using a file handle in perl and then write the code and close the file? Thanks

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 20:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found