Guest User

Untitled

a guest
Mar 7th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. package TMBO::Config;
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. use Config::Abstract::Ini;
  7.  
  8. use constant CONFIG_PATH => "db.ini";
  9.  
  10. sub get {
  11. my $ini = new Config::Abstract::Ini(CONFIG_PATH);
  12. my %config = $ini->get_entry('db');
  13. my $server = $config{'server'};
  14. my $db = $config{'db'};
  15. my $user = $config{'user'};
  16. my $pass = $config{'pass'};
  17.  
  18. my $db_string = "DBI:mysql:$db:$server";
  19. return ($db_string, $user, $pass);
  20. }
  21.  
  22. 1;
Add Comment
Please, Sign In to add comment