# MAIN PRORGRAM : ... # else { $gtheProcess = undef; $gtheProcess = new Registry ( file => $strDir."/".$strProcess ,verbose => $gblnVerbose ); } # REGISTRY MODULE : new () # sub new { my $class = shift; my $self = {}; my $theOptions = { @_ }; ....lots of code... if ( exists($self->{file}) ) { my $gxmlFile = $self->{file}; if ( open( ghdlFile, "< $gxmlFile" ) == 1 ) { close ghdlFile; # XML : Create a new XML object... my $gxmlObject = XML::Simple->new(); # OPEN : Open the configuration file... my $gxmlDocument = $gxmlObject->XMLin($gxmlFile); # CAPTURE : Grab all the configuration elements from the file... foreach my $lstrKey (keys (%{$gxmlDocument})) { $self->{$lstrKey} = $gxmlDocument->{$lstrKey}; } # end : foreach # FREE : Free up objects... # $gxmlDocument = undef; $gxmlObject = undef; } # end : if ( open( cfgFH, "< $gxmlConfigFile" ) == 1 ) } # if ( exists($self->{file}) ) return( bless($self, $class) ); } # end : new()