in reply to Re: Parsing a .gpx file with Geo::Gpx
in thread Parsing a .gpx file with Geo::Gpx

Count Zero, thanks for your reply, I inserted your text one space after the last word in line 6:

"or die "Error is opening gpx file: $!;

as you had instructed, with no luck, the error is below. I also tried some different combinations of positioning the " quotation marks and leaving them out all together.

paul@intern-PM:~/Desktop/San Diego$ perl gpxscript2 String found where operator expected at gpxscript2 line 6, near "'sandiegopark.gpx' "or die "" (Missing operator before "or die "?) Bareword found where operator expected at gpxscript2 line 6, near ""or die "Error" (Missing operator before Error?) syntax error at gpxscript2 line 6, near "'sandiegopark.gpx' "or die "" Global symbol "$fh_in" requires explicit package name at gpxscript2 line 8. Execution of gpxscript2 aborted due to compilation errors.

with no quotes I receive the message: paul@intern-PM:~/Desktop/San Diego$ perl gpxscript2 syntax error at gpxscript2 line 6, near "file:" Global symbol "$fh_in" requires explicit package name at gpxscript2 line 8. Execution of gpxscript2 aborted due to compilation errors.

Sorry, I'm not sure how to proceed from here. I was also looking at a XML parser, for you can do a save as .xml, do you suggest something like that?

  • Comment on Re^2: Parsing a .gpx file with Geo::Gpx

Replies are listed 'Best First'.
Re^3: Parsing a .gpx file with Geo::Gpx
by CountZero (Bishop) on Jun 28, 2012 at 06:36 UTC
    That line should read:
    open my $fh_in, '<', 'fells_loop.gpx' or die "Error in opening gpx fil +e: $!";
    Try it and see what error you get.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re^3: Parsing a .gpx file with Geo::Gpx
by frozenwithjoy (Priest) on Jun 27, 2012 at 23:34 UTC
    I'm not sure what the code looks like when you have it "without quotes", so to remove any confusion, could you revert to the script as it was without out the "or die" stuff and just add use autodie; to the top? What, if any, errors do you get now? Thanks.