in reply to Removing lines ending with integers larger than x

The first question would be to see if the file format you are dealing with is something that is already understood by a module at http://search.cpan.org.   (It may well be that your entire requirement has already been solved, and if so, switch your attention from building something, to finding it.)

If not, you need to use a regular expression such as something like this ... /\,([0-9]+)$/ ... which will locate lines ending with ("$") a literal comma ("\,") followed by group of one or more ("+") digits ("[0-9]"), and which will return the contents of that group to you as a separate variable ("$1") that you can now examine.

Since you want to ensure a numeric comparison, adding zero to it is an easy way ... my $value = $1 + 0; ... and then you simply see if it is 47 or greater.   One common way to do that, in a loop, is the slightly-different but very succinct, next unless $value >= 47;.

(Careful, now!   It is very easy to write what is not-obviously a string-based comparison that compiles, and that superficially appears to solve the problem in your test cases (if you actually ran any...) but that in fact is not telling the computer to do what you want.   Sux...)

I hope that this generalized description of the idea ... helps.