using DI in CPAN libs makes them more universal - but DI even more important is when you want to open-source some generic part of your application. Your boss agrees and then you encounter code like this:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub frobnicate { | |
#... | |
my $dbh = MyApp->dbh; | |
#... | |
} | |
# or | |
sub frobnicate { | |
#... | |
my $some_variable = MyApp::OurConstant; | |
#... | |
} | |
# or | |
sub frobnicate { | |
#... | |
my $sql = MyApp::Common::DBConnect(config => 'master'); | |
#... | |
} |