Hi all, looking for some help please? I have an output that lists some utilization stats (~0.00). These stats are appear twice (in/out) and are repeated three times per time round the for loop. I'm struggling with figuring out how to store these for each $lag_traffic and then pass them to a hash to store referencing which $lag_traffic they belong to for then onward evaluation later.

What I've got so far pulls out 6 ~0.00's and printing out %lag_load shows there's 6 values against each $lag_traffic, but not the actual values.
Totals 1144 12 1116 12 0 0 % Util ~0.00 -- ~0.00 -- -- - +- Totals 1720 18 1529 16 0 0 % Util ~0.00 -- ~0.00 -- -- - +- Totals 1539 16 1425 16 0 0 % Util ~0.00 -- ~0.00 -- -- - +-
foreach $lag_traffic (@lag_id) { my $text = $host->cmd("monitor lag $lag_traffic interval 3 repeat +3 rate | match Totals post-lines 1"); @lag_util = ( $text =~ m/(.\d+\.\d+)/g ); $lag_load{$lag_traffic} = @lag_util; }
$VAR1 = [ '~0.00', '~0.00', '~0.00', '~0.00', '~0.00', '~0.00' ]; $VAR1 = { '200' => 6, '199' => 6 };

In reply to Store and print multiple strings by bartrad

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.