pinkybrown has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to execute a script to extract an openstreetmap planet.osm file into a postgreSQL databse. The script calls on several modules, which I have so far managed to install without too much difficulty. However, I have stumbled across an error that I am unsure how to solve.
The error in this case relates to the planet.pm module, which uses the 'strict' pragma. When executing planetosm-to-db.pl the following error is returned:
Line 165 reads:Global symbol "$VERBOSE" requires explicit package name at /System/Lib +rary/Perl/5.8.6/darwin-thread-multi-2level/Geo/OSM/Planet.pm line 165 +. Global symbol "$DEBUG" requires explicit package name at /System/Libra +ry/Perl/5.8.6/darwin-thread-multi-2level/Geo/OSM/Planet.pm line 165.
print STDERR "Mirror OSM Data from $url\n" if $VERBOSE || $DEBUG;
which I altered toprint STDERR "Mirror OSM Data from $url\n" if my($VERBOSE) || my($DEBUG);
resulting in more explicit package name errors – on lines 175, 180, 195, 210, 237, 241, 243, 245, 259, 274, 281. Editing these lines in a similar manner returns the following error on lines 241, 243, 245, 259:I understand that I have too many instances of "my" but am not sure why, and therefore unsure how to proceed in order to get the module to run when I execute the script. Any explanation of what I have done wrong – and why it isn't working at present – would be very helpful. Thanks."my" variable $DEBUG masks earlier declaration in same scope at /Syste +m/Library/Perl/5.8.6/darwin-thread-multi-2level/Geo/OSM/Planet.pm lin +e 241. "my" variable $VERBOSE masks earlier declaration in same scope at /Sys +tem/Library/Perl/5.8.6/darwin-thread-multi-2level/Geo/OSM/Planet.pm l +ine 241.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "my" variables masking earlier declaration
by talexb (Chancellor) on Nov 06, 2007 at 17:10 UTC | |
|
Re: "my" variables masking earlier declaration
by ikegami (Patriarch) on Nov 06, 2007 at 17:09 UTC | |
|
Re: "my" variables masking earlier declaration
by Anonymous Monk on Nov 06, 2007 at 18:07 UTC | |
by pinkybrown (Initiate) on Nov 08, 2007 at 02:35 UTC | |
|
Re: "my" variables masking earlier declaration
by GrandFather (Saint) on Nov 06, 2007 at 21:41 UTC | |
by Anonymous Monk on Nov 07, 2007 at 09:18 UTC |