http://www.perlmonks.org?node_id=862817
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.
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; }
1;