in reply to redrafted code
Move the subroutine definition to somewhere else, for example to the top of your code, before the main part of the code starts. Then call the subroutine at the point in the code where you have now defined it.
Also note that when you split a line:
- the first token starts at index 0, so your latitude will be $tokens[4] and your longitute will be $tokens[5];
- the last token will contain the newline at the end of the line, so before splitting, you might want to chomp the line.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: redrafted code
by chromatic (Archbishop) on Feb 02, 2011 at 18:12 UTC |
In Section
Seekers of Perl Wisdom