From 6974fa8b0419bbd0711f79c8b78e07a9543810dd Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 1 Jul 2007 20:28:50 +0000 Subject: * activated 'use warnings' to all modules and adjusted all occurences of 'use of uninitialized values', a couple of which might still show up * adjusted all code with respect to passing perlcritic level 4 and 5 git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1207 95ad53e4-c205-0410-b2fa-d234c58c8868 --- bin/slxsettings | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'bin/slxsettings') diff --git a/bin/slxsettings b/bin/slxsettings index e753ad99..278cb2c2 100755 --- a/bin/slxsettings +++ b/bin/slxsettings @@ -14,6 +14,7 @@ # - OpenSLX-script to show & change local settings # ----------------------------------------------------------------------------- use strict; +use warnings; my $abstract = q[ slxsettings @@ -28,9 +29,6 @@ slxsettings Please use the --man option in order to read the full manual. ]; -use Getopt::Long qw(:config pass_through); -use Pod::Usage; - # add the lib-folder and the folder this script lives in to perl's search # path for modules: use FindBin; @@ -38,9 +36,13 @@ use lib "$FindBin::RealBin/../lib"; use lib "$FindBin::RealBin"; # development path to config-db stuff +use Getopt::Long qw(:config pass_through); +use Pod::Usage; + use OpenSLX::Basics; use OpenSLX::Utils; + my ($quiet, @reset, $helpReq, $manReq, $versionReq,); GetOptions( @@ -111,11 +113,8 @@ foreach my $key (@reset) { # ... and write local settings file if necessary if (keys %changed) { - my $f = "$openslxConfig{'config-path'}/settings"; - open(SETTINGS, "> $f") - or die _tr("Unable to write local settings file '%s' (%s)", $f, $!); - print SETTINGS $settings; - close(SETTINGS); + my $fileName = "$openslxConfig{'config-path'}/settings"; + spitFile($fileName, $settings); openslxInit(); @@ -135,13 +134,15 @@ if (!keys %changed) { print $text; my @baseSettings = grep { exists $cmdlineConfig{$_} } keys %openslxConfig; foreach my $key (sort @baseSettings) { - print qq[\t--$key='$openslxConfig{$key}'\n]; + my $val = $openslxConfig{$key} || ''; + print qq[\t--$key='$val'\n]; } print _tr("extended settings:\n"); my @extSettings = grep { !exists $cmdlineConfig{$_} } keys %openslxConfig; foreach my $key (sort @extSettings) { next if $key =~ m[^(base-path|config-path)$]; - print qq[\t$key='$openslxConfig{$key}'\n]; + my $val = $openslxConfig{$key} || ''; + print qq[\t$key='$val'\n]; } } -- cgit v1.2.3-55-g7522