Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 wandering the Monastery: (7)
As of 2015-07-02 04:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (27 votes), past polls