diff options
author | Tim Retout <tim@retout.co.uk> | 2012-02-19 19:30:21 +0000 |
---|---|---|
committer | Tim Retout <tim@retout.co.uk> | 2012-02-21 18:33:15 +0000 |
commit | 145a69f5df82d04d3dcde6709a2cc1f7cebcda66 (patch) | |
tree | 098f4d6b02f160f4473802e368c19dae478743e1 /solenv | |
parent | 2cd5042eb83ade5f883f5f6ea986bcdbd1e8f620 (diff) |
Remove unused save functions from various Perl modules.
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/modules/installer/files.pm | 49 | ||||
-rw-r--r-- | solenv/bin/modules/par2script/files.pm | 53 | ||||
-rw-r--r-- | solenv/bin/modules/pre2par/files.pm | 53 |
3 files changed, 2 insertions, 153 deletions
diff --git a/solenv/bin/modules/installer/files.pm b/solenv/bin/modules/installer/files.pm index cd2350dddb9f..1d9e7705166f 100644 --- a/solenv/bin/modules/installer/files.pm +++ b/solenv/bin/modules/installer/files.pm @@ -95,27 +95,6 @@ sub save_file } } -sub save_hash -{ - my ($savefile, $hashref) = @_; - - my @printcontent = (); - - my $itemkey; - - foreach $itemkey ( keys %{$hashref} ) - { - my $line = ""; - my $itemvalue = $hashref->{$itemkey}; - $line = $itemkey . "=" . $itemvalue . "\n"; - push(@printcontent, $line); - } - - open( OUT, ">$savefile" ) || installer::exiter::exit_program("ERROR: Cannot open file $savefile for writing", "save_hash"); - print OUT @printcontent; - close( OUT); -} - sub save_array_of_hashes { my ($savefile, $arrayref) = @_; @@ -144,34 +123,6 @@ sub save_array_of_hashes close( OUT); } -sub save_array_of_hashes_modules -{ - my ($savefile, $arrayref) = @_; - - my @printcontent = (); - - for ( my $i = 0; $i <= $#{$arrayref}; $i++ ) - { - my $line = "***************************************************\n"; - my $hashref = ${$arrayref}[$i]; - my $itemkey; - - foreach $itemkey ( keys %{$hashref} ) - { - my $itemvalue = $hashref->{$itemkey}; - $line = $line . $itemkey . "=" . $itemvalue . "\n"; - } - - $line = $line . "\n"; - - push(@printcontent, $line); - } - - open( OUT, ">$savefile" ) || installer::exiter::exit_program("ERROR: Cannot open file $savefile for writing", "save_array_of_hashes"); - print OUT @printcontent; - close( OUT); -} - ########################################### # Binary file operations ########################################### diff --git a/solenv/bin/modules/par2script/files.pm b/solenv/bin/modules/par2script/files.pm index 3b7e70d2d4a9..cc1be422939d 100644 --- a/solenv/bin/modules/par2script/files.pm +++ b/solenv/bin/modules/par2script/files.pm @@ -58,7 +58,7 @@ sub read_file } ########################################### -# Saving files, arrays and hashes +# Saving files ########################################### sub save_file @@ -70,55 +70,4 @@ sub save_file if (! -f $savefile) { pre2par::exiter::exit_program("ERROR: Cannot write file: $savefile", "save_file"); } } -sub save_hash -{ - my ($savefile, $hashref) = @_; - - my @printcontent = (); - - my ($itemkey, $itemvalue, $line); - - foreach $itemkey ( keys %{$hashref} ) - { - $line = ""; - $itemvalue = $hashref->{$itemkey}; - $line = $itemkey . "=" . $itemvalue . "\n"; - push(@printcontent, $line); - } - - open( OUT, ">$savefile" ); - print OUT @printcontent; - close( OUT); -} - -sub save_array_of_hashes -{ - my ($savefile, $arrayref) = @_; - - my @printcontent = (); - - my ($itemkey, $itemvalue, $line, $hashref); - - for ( my $i = 0; $i <= $#{$arrayref}; $i++ ) - { - $line = ""; - $hashref = ${$arrayref}[$i]; - - foreach $itemkey ( keys %{$hashref} ) - { - $itemvalue = $hashref->{$itemkey}; - - $line = $line . $itemkey . "=" . $itemvalue . "\t"; - } - - $line = $line . "\n"; - - push(@printcontent, $line); - } - - open( OUT, ">$savefile" ); - print OUT @printcontent; - close( OUT); -} - 1; diff --git a/solenv/bin/modules/pre2par/files.pm b/solenv/bin/modules/pre2par/files.pm index e3de88b6dd4e..6dbfd9358140 100644 --- a/solenv/bin/modules/pre2par/files.pm +++ b/solenv/bin/modules/pre2par/files.pm @@ -57,7 +57,7 @@ sub read_file } ########################################### -# Saving files, arrays and hashes +# Saving files ########################################### sub save_file @@ -71,55 +71,4 @@ sub save_file if (! -f $savefile) { pre2par::exiter::exit_program("ERROR: Cannot write file: $savefile", "save_file"); } } -sub save_hash -{ - my ($savefile, $hashref) = @_; - - my @printcontent = (); - - my ($itemkey, $itemvalue, $line); - - foreach $itemkey ( keys %{$hashref} ) - { - $line = ""; - $itemvalue = $hashref->{$itemkey}; - $line = $itemkey . "=" . $itemvalue . "\n"; - push(@printcontent, $line); - } - - open( OUT, ">$savefile" ); - print OUT @printcontent; - close( OUT); -} - -sub save_array_of_hashes -{ - my ($savefile, $arrayref) = @_; - - my @printcontent = (); - - my ($itemkey, $itemvalue, $line, $hashref); - - for ( my $i = 0; $i <= $#{$arrayref}; $i++ ) - { - $line = ""; - $hashref = ${$arrayref}[$i]; - - foreach $itemkey ( keys %{$hashref} ) - { - $itemvalue = $hashref->{$itemkey}; - - $line = $line . $itemkey . "=" . $itemvalue . "\t"; - } - - $line = $line . "\n"; - - push(@printcontent, $line); - } - - open( OUT, ">$savefile" ); - print OUT @printcontent; - close( OUT); -} - 1; |