use strict; my $content = '{ "geometry": { "type": "Polygon", "coordinates": [ [ [ 19.054804912278406, 47.485785556135411 ], [ 19.057857836771483, 47.487322542030711 ], [ 19.06025597925397, 47.488491565765209 ], [ 19.060347248086835, 47.488539642204628 ], [ 19.060463310421543, 47.484578287406251 ], [ 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? }