From 8dfe0461d5e4ae3ef31c0a01a9cc04e7334a458c Mon Sep 17 00:00:00 2001 From: Jacob Pipkin Date: Mon, 11 Jun 2012 23:05:21 -0500 Subject: bunch more code reductions and stuff --- sboconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sboconfig') diff --git a/sboconfig b/sboconfig index e9a2ff6..4cb7278 100755 --- a/sboconfig +++ b/sboconfig @@ -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"; -- cgit v1.2.3