Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

(MeowChow) Re3: DBIx::PearDSN

by MeowChow (Vicar)
on Apr 08, 2002 at 19:58 UTC ( #157533=note: print w/replies, xml ) Need Help??


in reply to Re: (MeowChow) Re: DBIx::PearDSN
in thread DBIx::PearDSN

I always try to scope such mapping hashes to the subs that need them. Only dsi_dsn needs the %map, so why make it available to other subs? There's also no point in having it global.
This is exactly why I suggested the alternative of creating a new enclosing scope, as in:
{ my %map = (...); sub dbs_dsn { ... } }
Even for a sub that isn't called very often, why do the work every time and throw it away, when you can do it just once?
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://157533]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2016-10-01 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (5 votes). Check out past polls.