in reply to Re^6: Calculate aircraft headings from GPS data for google kml display
in thread Calculate aircraft headings from GPS data for google kml display

You're slurping the entire file into an array:

open(INPUT, $infile); my @lines = <INPUT>; close(INPUT);

Which means by the time you reach where I loaded the header line:

my @headers = split ' ', do{ my $raw = <INPUT>; $raw =~ tr[",][ ]; $ra +w }; #"

There is nothing left to read.

Either shift the first line off of the array:

my @headers = split ' ', do{ my $raw = shift @lines; $raw =~ tr[",][ ] +; $raw }; #"

Or don't slurp the file and revert to using while.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^8: Calculate aircraft headings from GPS data for google kml display
by hujunsimon (Sexton) on Jun 26, 2014 at 15:01 UTC

    Hi BrowserUk, sorry, went away for holiday last week. thanks a lot for your advice, it works like a charm now !

    Simon