A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Perl/perl5/issues/17399 below:

hash_seed in SYNOPSIS · Issue #17399 · Perl/perl5 · GitHub

Where
Hash::Util SYNOPSIS

Description
The line

my $hashes_are_randomised = hash_seed() != 0;

does not work anymore for newer perls. Here's a oneliner test:

$ perl5.31.7 -MTest::More=no_plan -w -MHash::Util=hash_seed -e 'my $hashes_are_randomised = hash_seed() != 0; ok $hashes_are_randomised'      
Argument "�UM-^X4^VJ^I�VJ=aM-^T�Z�,}M-\foHM-^F�Y$" isn't numeric in numeric ne (!=) at -e line 1.
not ok 1
#   Failed test at -e line 1.
1..1
# Looks like you failed 1 test of 1.

What would work (also with older perls) is a regexp test like this:

$ perl5.31.7 -MTest::More=no_plan -w -MHash::Util=hash_seed -e 'my $hashes_are_randomised = hash_seed() !~ /^\0+$/; ok $hashes_are_randomised'
ok 1
1..1

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4