Couple of things that I saw.
if ($_ ne "Pr:" and $tr == 0)
with this statement you can not have anything follow the "Pr:" which your test data has a comment.
if (!/^Pr:/ and $tr == 0)
Looks like it will work better.

I would also just sort your data and pull off the highest value instead of the 2 foreach's

A style issue that would've helped solve this:
You're naming could be much more descriptive. When I first started I was like you. I kept thinking "this is a throw-away script" or "I'm the only one who will see this" but, it never turns out that way. So now even on scripts "I know" will be throw away and no one will ever look at I use good names and proper style, because I KNOW they will not be thrown away and someone will look at them :)

Fredrick Brooks paraphrased from The Mythical Man-Month:
Show me your [code] and conceal your [data structures], and I shall continue to be mystified. Show me your [data structures], and I won't usually need your [code]; it'll be obvious.


grep
grep> chown linux:users /world

In reply to Re: Parsing by grep
in thread Parsing tips by smgfc

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.