Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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


Comment on (MeowChow) Re3: DBIx::PearDSN
Download Code

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 contemplating the Monastery: (6)
As of 2014-08-01 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls