my $dbh = DBIx::Password->connect($user); #### my $dbh = DBIx::Password->connect($user); #### sub staging_phase { my($self)=@_; my %phase = ( 'bens.laptop' => 'devel', 'devel.xyz.com' => 'devel', 'webadmin.xyz.com' => 'prod', 'staging.xyz.com' => 'prod' , ); my $h = $self->hostname; my $phase = $ENV{STAGE_PHASE} || $phase{$h} or die 'Could not determine stage phase hostname: $h' ; $self->log->debug( "$phase" ) ; $phase; } sub attributes { $attributes { $self->staging_phase } ; } sub connect { DBI->connect($u, $p, $dsn, $self->attributes); } #### DBIx::Password->connect("${user}_${staging_phase}");