alincoln has asked for the wisdom of the Perl Monks concerning the following question:
Does Perl like/dislike explicit memory management by setting the above $gxmlDocument and $gxmlObject = undef?# MAIN PRORGRAM : ... # else { $gtheProcess = undef; $gtheProcess = new Registry ( file => $strDir."/".$strProcess ,verbose => $gblnVerbose ); } <snip> # 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 f +ile... 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()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Memory Management...
by Abigail-II (Bishop) on Feb 03, 2004 at 16:54 UTC | |
by scottj (Monk) on Feb 04, 2004 at 05:31 UTC | |
|
Re: Memory Management...
by welchavw (Pilgrim) on Feb 03, 2004 at 17:04 UTC | |
|
Re: Memory Management...
by Fletch (Bishop) on Feb 03, 2004 at 17:14 UTC | |
|
Re: Memory Management...
by ysth (Canon) on Feb 03, 2004 at 17:46 UTC | |
|
Re: Memory Management...
by hardburn (Abbot) on Feb 03, 2004 at 20:34 UTC | |
|
Re: Memory Management...
by bean (Monk) on Feb 04, 2004 at 00:13 UTC |