in reply to foreach nightmare!
Surround this with your loop and you may be golden (there are better regexes to match a floating number, but this should serve your purpose with the above dataset):
my ($highest) = sort { $b <=> $a } $string =~ /([\d\.-]+)/g; print "$highest\n";
|
---|