in reply to Help with regex, how to get the largest integer in a string?

Here is a fairly simple solution that nobody seems to have suggested. It processes the data line by line, pulling all the integers from each line into an array using a simple regex with the g quantifier, then reverse sorts the array, and finally prints the first element. The code is probably a bit more verbose than it needs to be, but that is deliberate as you mention that you are new to PERL Perl.
#!/usr/bin/perl -w use strict; # Read each line one by one while (my $line = <DATA>) { chomp($line); # Dispense with trailing newline # Extract everything that looks like an integer into an array my @ints = $line =~ m/(\d+)/g; # Sort the array, highest to lowest my @sorted_ints = reverse sort { $a <=> $b } @ints; # Ouput the line, and the highest integer (1st element of the sort +ed array) print "DATA:$line\nHIGHEST INTEGER:$sorted_ints[0]\n"; } __DATA__ ASBSDEC 34 GADVVEEVEETTE 56 IOEOREAK GKJEOG EFEAF 1090 DAFFEE 376 ASB C 134 PPKOREAK EFEAF 290 BLAH 99 BLAH 123 FRED 27 BARNEY 427
Output:
DATA:ASBSDEC 34 GADVVEEVEETTE 56 IOEOREAK GKJEOG EFEAF 1090 DAFFEE 376 HIGHEST INTEGER:1090 DATA:ASB C 134 PPKOREAK EFEAF 290 HIGHEST INTEGER:290 DATA:BLAH 99 BLAH 123 FRED 27 BARNEY 427 HIGHEST INTEGER:427
Hope this helps,
Darren :)