There's more than one way to do things | |
PerlMonks |
Passing $dbh to subroutine - cluestick whack neededby mikeraz (Friar) |
on May 02, 2012 at 12:20 UTC ( [id://968436]=perlquestion: print w/replies, xml ) | Need Help?? |
mikeraz has asked for the wisdom of the Perl Monks concerning the following question: I'm attempting to pass a database handle to a subroutine. Searches around here return posts that say "It just works." And as I review my code it seems I'm doing the RightThing(tm) Please point out what I am doing wrong. Update: moritz quickly identified the problem. You probably can too. If you can't spot it right off, then you have a nice little exercise to work. I've created a small database derived from US Census Gazetteer data. For each county in the US it contains, among other bits, the FIPS ID and latitude/longitude center point. The point of the code is take an arbitrary lat/long coordinate and determine which counties are "nearby". The code in which I set things up:
Though comments on my proto-modularization will be appreciated I'm really here to resolve how to pass the database handle into the sub routine. Be Appropriate && Follow Your Curiosity
Back to
Seekers of Perl Wisdom
|
|