From 3e95ef30eee0176244b04dba8e394c95a1adadd2 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 31 Mar 2010 17:46:49 +0200 Subject: checklinks: Minor code cleanup number UINT32_MAX (or so) --- bin/checklinks | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'bin') diff --git a/bin/checklinks b/bin/checklinks index af0357c..289f438 100755 --- a/bin/checklinks +++ b/bin/checklinks @@ -25,8 +25,8 @@ sub mkdirs { # the last element is the file pop(@dirs); - foreach(@dirs) { - unless(-d "$path/$_") { + foreach (@dirs) { + if (not -d "$path/$_") { mkdir("$path/$_") or die("Can't create $path/$_: $!"); } $path .= $_; @@ -45,10 +45,10 @@ sub dir_content { push(@return, $entry); - if (!$dot_file and $entry =~ /^\./) { + if (not $dot_file and $entry =~ /^\./) { $dot_file = 1; } - elsif (!$normal_file) { + elsif (not $normal_file) { $normal_file = 1 } } @@ -195,7 +195,7 @@ else { exit(0); } -open(my $links, '<', $linkfile) or die("Can't open $linkfile: $!"); +open(my $links, '<', $linkfile) or die("Cannot open $linkfile: $!"); while (my $line = <$links>) { chomp($line); @@ -205,7 +205,7 @@ while (my $line = <$links>) { my ($type, $src, $dst) = split(/\s+/, $line); - next unless ($type ~~ ['soft', 'hard', 'auto']); + next if (not($type ~~ ['soft', 'hard', 'auto'])); if ($type eq 'auto') { loop_links(); @@ -222,7 +222,7 @@ while (my $line = <$links>) { } } } -close($links); +close($links) or die("Cannot close $linkfile: $!"); exit($exit); -- cgit v1.2.3