Skip to main content



I'm attempting to port this C hashing function to Perl but it's not working:

c static inline uint64_t hash64(uint64_t val, unsigned bits) { return (val * 0x61c8864680b583ebull) >> (64 - bits); }

Here is what I came up with:

``` sub hash64 { my ($val, $bits) = @_; my $magic_constant = 0x61c8864680b583eb;

# Perform the hash computation my $hashed = ($val * $magic_constant) >> (64 - $bits); return $hashed; 

} ```

My hashed values aren't matching what I'm seeing from C. I suspect it has to do with how Perl handles numbers larger than 64bit? C would truncate them (I think) but Perl will happily work with larger numbers?

12345 hashed to 64bits should output 6832837858993532755 according to the C version. Am I missing something obvious?

submitted by /u/scottchiefbaker
[link] [comments]



Hi, I am installing braker and it requires a set of Perl modules to be installed. I am having a hard time installing the YAML::XS module. I am using Perl v5.38.

The Perl module was installed using cpanm command, and when I run perldoc -l YAML::XS it shows There is No documentation.

The directory, where the libraries and executables exist, was added to the PATH and PERL5LIB environment variable, and still the XS.pm is missing in the YAML folder.

I tried to re-install the library in two different ways: cpanm --local-lib=~/perl5 --reinstall YAML::XS and cpanm --force -v YAML::XS still not resolved.

What is happening here, should I install a different version of Perl? Is it possible to manually install YAML/XS.pm?

submitted by /u/learnwithscholar
[link] [comments]



London Perl Workshop 2024 - Preview : Perl Hacks submitted by /u/davorg
[link] [comments]


submitted by /u/niceperl
[link] [comments]


The URI module took a short holiday, but quickly returned. Just for giggles, I'd like to see everyone react (positivily) to u/oalders in the Github issue:

  • Can we get 100 reactions?
  • Can we get all the reactions (so, thumbs down is really just for completeness)
  • Can we star the heck out of the libperl-www repo?

There are people who take care of things so most people never notice when something goes wrong, and from the time I reported this to resolution was three hours (although the issue was already known, I think). That's some pretty good support right there, and we should fête over that.

For what it's worth, GitHub pays attention to these things. When I filed an issue about getting them to think about putting Perl in their Advisory Database, the number of reactions that issue got made them think about it (right now it's a whole process with scheduling dev time, etc). One of the ways to show that Perl is alive is to react to Perl things (um, that deserve it, not bot spam!).

submitted by /u/briandfoy
[link] [comments]