lmocsi has asked for the wisdom of the Perl Monks concerning the following question:
use strict; my $content = '{ "geometry": { "type": "Polygon", "coordinates": [ [ [ + 19.054804912278406, 47.485785556135411 ], [ 19.057857836771483, 47.4 +87322542030711 ], [ 19.06025597925397, 47.488491565765209 ], [ 19.060 +347248086835, 47.488539642204628 ], [ 19.060463310421543, 47.48457828 +7406251 ], [ 19.054804912278406, 47.485785556135411 ] ] ] } }'; while ($content =~ /(\d\d\.\d*)/g){ my $num = substr($1,0,9); # number is shortened, but how do I use it? }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: In-place regex substitution
by toolic (Bishop) on Dec 09, 2016 at 21:39 UTC | |
by AnomalousMonk (Archbishop) on Dec 10, 2016 at 00:06 UTC | |
by lmocsi (Novice) on Dec 09, 2016 at 21:45 UTC | |
by LanX (Saint) on Dec 09, 2016 at 21:59 UTC | |
|
Re: In-place regex substitution
by Marshall (Canon) on Dec 10, 2016 at 07:54 UTC | |
by AnomalousMonk (Archbishop) on Dec 10, 2016 at 15:49 UTC | |
by LanX (Saint) on Dec 10, 2016 at 15:36 UTC |