diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-06-11 23:05:21 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-06-11 23:05:21 -0500 |
commit | 8dfe0461d5e4ae3ef31c0a01a9cc04e7334a458c (patch) | |
tree | d9c78b0077beb355f19075614759074b1ecc09b2 /sboconfig | |
parent | 3fe7112f8c96478a55eeebe0d63665c1435c5dda (diff) | |
download | sbotools2-8dfe0461d5e4ae3ef31c0a01a9cc04e7334a458c.tar.xz |
bunch more code reductions and stuff
Diffstat (limited to 'sboconfig')
-rwxr-xr-x | sboconfig | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -14,6 +14,7 @@ use File::Basename; use Getopt::Std; use File::Copy; use File::Path qw(make_path); +use File::Temp qw(tempfile);; my %config = %SBO::Lib::config; my $self = basename ($0); @@ -80,7 +81,7 @@ my $conf_file = $SBO::Lib::conf_file; # safely modify our conf file; copy to a temp location, edit the temp file, # move the edited file into place sub config_write { - script_error ('config_write requires two arguments.') unless exists $_[1]; + exists $_[1] or script_error ('config_write requires two arguments.'); my ($key, $val) = @_; if (! -d $conf_dir) { mkdir ($conf_dir) or die "Unable to create $conf_dir. Exiting.\n"; |