123 45 -23 56 <-3.45
145 555 112 -12.0 -2.55
>From those lines, is it just the -3.45 and -2.55 that you are after? If so
then the following should work.
my @lines = ('123 45 -23 56 <-3.45', '145 555 112 -12.0 -2.55');
foreach (@lines) {
/(-?\d*\.?\d+)$/;
print "Found $1\n";
}
Nestor Florez wrote:
> Hi there,
>
> I am trying to read a file and find the last numeric value in the line read.
> example:
> 123 45 -23 56 <-3.45
> 145 555 112 -12.0 -2.55
>
> all of the values are separated by a space and I am looking for the last
> value.
> I tried
If you know that the valu