in reply to How to read string with numbers
Hello luxs,
I don’t think you need a module for this task. Does the following meet your requirements?
#! perl use strict; use warnings; use Data::Dump; while (my $line = <DATA>) { my @strings = split /\s+/, $line; my @floats = map { $_ + 0 } @strings; dd \@floats; } __DATA__ 360.000 -0.000100033 -1.76122e-05 -9.89111e-05 -1.9003e-05 640.000 -4.54467e-05 9.13758e-05 -4.50576e-05 9.04804e-05
Output:
13:40 >perl 1272_SoPW.pl [360, -0.000100033, -1.76122e-005, -9.89111e-005, -1.9003e-005] [640, -4.54467e-005, 9.13758e-005, -4.50576e-005, 9.04804e-005] 13:40 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|