diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-08-13 01:32:33 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-08-13 02:02:37 +0200 |
commit | 19c1b93b15712d5cd249e8578d6c23c7d20e6ce8 (patch) | |
tree | 22c778d1aaf3f1be264a0d9b369eb18baf433852 /sbin | |
parent | 35c54362d5ae43b98881154024b61d9bf1c63d61 (diff) | |
download | common-data-19c1b93b15712d5cd249e8578d6c23c7d20e6ce8.tar common-data-19c1b93b15712d5cd249e8578d6c23c7d20e6ce8.tar.gz common-data-19c1b93b15712d5cd249e8578d6c23c7d20e6ce8.tar.bz2 common-data-19c1b93b15712d5cd249e8578d6c23c7d20e6ce8.tar.xz common-data-19c1b93b15712d5cd249e8578d6c23c7d20e6ce8.zip |
perl_checker cleanups
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/chksession | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sbin/chksession b/sbin/chksession index 46a6071..fb2e099 100644 --- a/sbin/chksession +++ b/sbin/chksession @@ -6,7 +6,7 @@ # Modified by Bernard Lang on August 21, 2003. -my @lf; +my (@lf, $dir, $first, $list, $list_order, %order, $test); sub usage { my $e = shift @_; @@ -38,15 +38,15 @@ EOF sub cat { # returns content of argument file as a single string my ($f) = @_; - local *F; - open F, $f or die "Can't open $f\n"; + open my $F, $f or die "Can't open $f\n"; local $/ = ""; - <F> + <$F>; } sub parse_file { # parse a session descriptor file my ($fn) = @_; - $_ = cat ($fn); + my $n; + local $_ = cat($fn); ($n = $1) =~ s| ||g if /^NAME=(.*)/m; $e = $1 if /^EXEC=(.*)/m; my $dn = $1 if /^DESKTOPNAMES=(.*)/m; @@ -122,10 +122,10 @@ chdir $dir; for (<*>) { next if /.*~/; next if /.*\.rpm(save|old)/; - parse_file ("$_"); + parse_file($_); } -my ($e) = eval {cat("/etc/sysconfig/desktop")} =~ /DESKTOP=(\S+)/; +my ($e) = eval { cat("/etc/sysconfig/desktop") } =~ /DESKTOP=(\S+)/; # The first string (without spaces) in the file is copied to $e. # If $e is one of the names in @lf, then it is placed first (leftmost). |