Linux::Perl::getrandom
my $numbytes = Linux::Perl::getrandom::x86_64->getrandom( buffer => \$buffer, flags => [ 'RANDOM', 'NONBLOCK' ], ); # … or, platform-neutral: my $numbytes = Linux::Perl::getrandom->getrandom( buffer => \$buffer, flags => [ 'RANDOM', 'NONBLOCK' ], );
This is an interface to Linux’s getrandom system call. This system call is documented only for kernel 3.17 and after; however, it appears to be present in some earlier kernel versions.
getrandom
To install Linux::Perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Linux::Perl
CPAN shell
perl -MCPAN -e shell install Linux::Perl
For more information on module installation, please visit the detailed CPAN module installation guide.