Help with some codes

R

Rufina Paris

heya all!

well, am such a newbies in this world of ruby language, though! i found
it very interesting language and i am pretty much can catch up myself
but not as fast as i've thought. anyway, below are some source code
which i need some alternation to make it loop and adding 'while'
statement...anybody could have something to say??

regards

Attachments:
http://www.ruby-forum.com/attachment/2804/alert3.txt
 
B

Brian Candler

Ingrid said:
heya all!

well, am such a newbies in this world of ruby language, though! i found
it very interesting language and i am pretty much can catch up myself
but not as fast as i've thought. anyway, below are some source code
which i need some alternation to make it loop and adding 'while'
statement...anybody could have something to say??

regards

I think your problem line should be changed to

macaddr.each { |mac, aplist| puts "\n ALERT!\t\n An Imitation of MAC
address
#{mac} were found >> #{aplist.inspect}" if aplist.size > 1}

(Note in particular that you iterate over the hash 'macaddr', not the
closed IO object mac_conf, and since aplist is an array you need to
check aplist.size)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,199
Messages
2,571,045
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top