Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

(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?
               s aamecha.s a..a\u$&owag.print

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2015-11-26 12:47 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (698 votes), past polls