diff --git a/directiv.pl b/directiv.pl index 684f542a..0417f565 100755 --- a/directiv.pl +++ b/directiv.pl @@ -95,7 +95,7 @@ if ($output eq 'h') { } @hashinfo = gen_perfect_hash(\%directive); - if (!defined(@hashinfo)) { + if (!@hashinfo) { die "$0: no hash found\n"; } diff --git a/perllib/phash.ph b/perllib/phash.ph index 5bc2744a..936978a5 100644 --- a/perllib/phash.ph +++ b/perllib/phash.ph @@ -161,7 +161,7 @@ sub gen_perfect_hash($) { for ($j = 0; $j < $maxj; $j++) { $sv = $random_sv_vectors[$j]; @hashinfo = gen_hash_n($n, $sv, $href, $run++); - return @hashinfo if (defined(@hashinfo)); + return @hashinfo if (@hashinfo); } $n <<= 1; } diff --git a/phash.pl b/phash.pl index cc9ca741..3ef6e714 100755 --- a/phash.pl +++ b/phash.pl @@ -75,7 +75,7 @@ sub main() { %data = read_input(); @hashinfo = gen_perfect_hash(\%data); - if (!defined(@hashinfo)) { + if (!@hashinfo) { die "$0: no hash found\n"; } diff --git a/pptok.pl b/pptok.pl index c9738d37..be85b942 100755 --- a/pptok.pl +++ b/pptok.pl @@ -164,7 +164,7 @@ if ($what eq 'c') { } my @hashinfo = gen_perfect_hash(\%tokens); - if (!defined(@hashinfo)) { + if (!@hashinfo) { die "$0: no hash found\n"; } diff --git a/tokhash.pl b/tokhash.pl index 0c69c034..6c058026 100755 --- a/tokhash.pl +++ b/tokhash.pl @@ -183,7 +183,7 @@ if ($output eq 'h') { # @hashinfo = gen_perfect_hash(\%tokens); - if (!defined(@hashinfo)) { + if (!@hashinfo) { die "$0: no hash found\n"; }