Fix Perl deprecation warnings.
Use of defined on aggregates (hashes and arrays) is deprecated. You should instead use a simple test for size.
This commit is contained in:
parent
af43b97514
commit
bc8522e3a0
5 changed files with 5 additions and 5 deletions
|
@ -95,7 +95,7 @@ if ($output eq 'h') {
|
|||
}
|
||||
|
||||
@hashinfo = gen_perfect_hash(\%directive);
|
||||
if (!defined(@hashinfo)) {
|
||||
if (!@hashinfo) {
|
||||
die "$0: no hash found\n";
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
2
phash.pl
2
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";
|
||||
}
|
||||
|
||||
|
|
2
pptok.pl
2
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";
|
||||
}
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ if ($output eq 'h') {
|
|||
#
|
||||
|
||||
@hashinfo = gen_perfect_hash(\%tokens);
|
||||
if (!defined(@hashinfo)) {
|
||||
if (!@hashinfo) {
|
||||
die "$0: no hash found\n";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue