#!/usr/bin/perl use strict; use warnings; use Geo::Gpx; my $gpx_document = "test.gpx"; my $gpx = Geo::Gpx->new( input => $gpx_document); my $iter = $gpx->iterate_trackpoints(); while (my $pt = $iter ()){ print "Point: ", join(', ', $pt->{lat}, $pt->{lon}),"\n"; }