From a0ac34529effe5ac75542b6b843aea47e5d2a7b1 Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Wed, 30 May 2012 14:31:44 -0500 Subject: copy conf file to temp file instead of reading conf file and writing its contents to temp file, and remove unneeded "use Fcntl;" line. --- sboconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sboconfig b/sboconfig index 83fdcea..967819b 100755 --- a/sboconfig +++ b/sboconfig @@ -14,7 +14,6 @@ use File::Basename; use Getopt::Std; use File::Copy; use File::Path qw(make_path); -use Fcntl; my %config = %SBO::Lib::config; my $self = basename ($0); @@ -93,9 +92,8 @@ sub config_write { if (-f $conf_file) { # get a temp file and fill it with the contents of our config file my ($fh, $filename) = make_temp_file (); - open my $reader, '<', $conf_file; - print {$fh} <$reader>; close $fh; + copy ($conf_file, $filename) # tie the file so that if $key is already there, we just change that # line and untie it tie my @temp, 'Tie::File', $filename; -- cgit v1.2.3