use DBD::SQLite; use Data::Dumper; use strict; use warnings; my $dbh = DBI->connect("dbi:SQLite:uri=file:osopenusrn_202203.gpkg?mode=rwc"); my $tab = $dbh->prepare("SELECT * FROM openUSRN"); $tab->execute; my $data = $tab->fetchrow_hashref; my @test = unpack "(H2)2 CCVd6CVV", $data->{'geometry'}; foreach my $t(@test) { print "$t\n"; } print "\n-----\n\n"; printf ('%f ', $test[4]); printf ('%f', $test[6]); #### 47 | - G 50 | - P 0 - version 5 - flags (Little Endian & envelope type 2) 27700 - SRS (OSGB 1936) 637590.385 | - min_x -| 642426.601 | - max_x | 309577.58 | - min_y |- envelope 310361.391000001 | - max_y | 0 | - min_z | 0 | - max_z -| 1 - StandardGeoPackageBinary encoding (Little Endian) 1005 - StandardGeoPackageBinary type (MultiLineString Z) 34 - Number of LineStrings ----- 27700.000000 642426.601000