Hi Monks!
I've written a script using Net::Telnet::Cisco to log into an access point and capture information about associated clients. I simply output this to a log file and then parse the file. What I'd like to do is take only the values MAC address, Signal Strength, and Signal-to-Noise Ratio from the output for each client. What I will do is load the output file and parse each line with regex to pull out the relevant data. However, not knowing how many clients will be associated at any one time, how can I create an associative array for each client that will hold the relevant data? For example, can I create arrays named '%client_i' where the value of i simply increments from 0 to the number of clients returned? A new client will be identified each time a MAC address is found while parsing the output log. Secondly, can I use each of these '%client_i' arrays to store key/value pairs such as
%client_0 = ("MAC",$mac,"RSSI",$rssi,"SNR",$snr);
Thanks in advance.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.