diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-05-30 14:31:44 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-05-30 14:31:44 -0500 |
commit | a0ac34529effe5ac75542b6b843aea47e5d2a7b1 (patch) | |
tree | 008df7ff3100e6221e2bbb233bdd0b9e4b11db02 | |
parent | c64341a1835997d4c19c0682517d134380d58ece (diff) | |
download | sbotools2-a0ac34529effe5ac75542b6b843aea47e5d2a7b1.tar.xz |
copy conf file to temp file instead of reading conf file and writing its contents to temp file, and remove unneeded "use Fcntl;" line.
-rwxr-xr-x | sboconfig | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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; |