in reply to Re^2: My Perl-foo... SORT is not strong
in thread My Perl-foo... SORT is not strong

Note the spelling: "Relevant" is not "Relevent".
  • Comment on Re^3: My Perl-foo... SORT is not strong

Replies are listed 'Best First'.
Re^4: My Perl-foo... SORT is not strong
by Greg@Work (Initiate) on Mar 19, 2015 at 16:50 UTC

    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" } }
      "e" and "a" are different characters in all the positions:
      Relevant Relavant Relevent
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        Yes! my problems are all things of the past. My thanks for the original solution to sorting (which does work) and the help in reading my very own spelling errors. Both solutions were, and continue to be, relevant!

Re^4: My Perl-foo... SORT is not strong
by marinersk (Priest) on Mar 19, 2015 at 15:40 UTC

    But its spelling is relevant.