in reply to Config files

You can make your own class to process config files. For plain config files it may looks like this:
package PlainConfig; use strict; use Carp; use vars qw($AUTOLOAD); sub new{ my $self=shift; my $config=shift || croak "There is no path parameter specified"; my $new={}; open CONFIG, $config || croak "Couldn't open config file - $config"; while (<CONFIG>){ s/^\s*//; next if (/^\s*#/ or /^$/); /^([^=\s]+)\s*=\s*([^\n\r]*)/; $new->{$1}=$2; } close CONFIG; bless $new, $self; return $new; } sub AUTOLOAD{ my $self=shift; my $attr=$AUTOLOAD; $attr=~s/(.*::)+//; return $self->{$attr}; } 1;
Then your script will be looks like this:
use PlainConfig; my $config=new PlainConfig; print "Username: ".$config->username."\n";
But there are many other approaches. Choose the best.