Thank you for your patience. I fixed my spelling errors... *looks sheepish*. Still got the Global symbol "%Relavant" requires explicit package name at PSFT_Automation.pl line 636. Error. (line 636 is the line my $RelavantCount = scalar keys %Relavant; near the end). 2 things look strange to me.. one is I'm declaring the hash at the first line.. Adding to the hash uses $ not %... is that correct? and secondly is this the proper way to get a count of the elements in the hash? my $RelavantCount = scalar keys %Relavant; ?? Again, can't thank you guys enough.

my %Relevant; my %Possible; foreach my $e (@{$data->{check}}) { #first go though the health checks looking to see if we have r +elevant checks for this event code if ($e->{Relavant_events} =~ $FindEvent ) { $WantedFile = $e->{filename}; $WantedText = $e->{find}; #scan the files for the text we are after DXWanted(); if ($FileStatus == 1) { $Relevant{$e->{severity}} = $e->{note}; $FileStatus = 0; } } #we also want to run checks for non-relevant items, so we can +add them under the "Automation also found..." text on the internal no +te. else{ $WantedFile = $e->{filename}; $WantedText = $e->{find}; #scan the files for the text we are after DXWanted(); if ($FileStatus == 1) { $Possible{$e->{severity}} = $e->{note}; $FileStatus = 0; } } } #all the checks have been run - now sort the 2 hashes, and print o +ut their contents to the note. my $RelavantCount = scalar keys %Relavant; if ($RelavantCount >= 1) { foreach my $name (sort { $b <=> $a } keys %Relavant) { $RESULTS = $RESULTS . "Severity: " . $name . "\n" . $Relavant{ +$name} . "\n\n" } }

In reply to Re^4: My Perl-foo... SORT is not strong by Greg@Work
in thread My Perl-foo... SORT is not strong by Greg@Work

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.