bichonfrise74 has asked for the wisdom of the Perl Monks concerning the following question:
My goal is to able to switch from a sandbox user to production user. So, I have the code below. I am wondering if this is a good approach or if there is a better way.
1;package Testme; use warnings; use strict; use Exporter; sub New { my ($class) = @_; my $self = { sandbox => '0', }; if ($self->{sandbox} == 1) { $self->{user} = 'sandbox_user'; $self->{password} = 'sandbox_password'; } else { $self->{user} = 'production_user'; $self->{password} = 'production_password'; } bless( $self, $class ); return $self; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Configuration Question
by moritz (Cardinal) on Sep 30, 2010 at 18:16 UTC | |
Re: Configuration Question
by ikegami (Patriarch) on Sep 30, 2010 at 18:43 UTC | |
by Anonymous Monk on Sep 30, 2010 at 19:08 UTC | |
by TomDLux (Vicar) on Sep 30, 2010 at 20:15 UTC | |
by ikegami (Patriarch) on Sep 30, 2010 at 19:29 UTC | |
Re: Configuration Question
by hesco (Deacon) on Oct 01, 2010 at 01:41 UTC |
Back to
Seekers of Perl Wisdom