#! perl -slw use strict; sub random { my $count = shift; use Win32::API::Prototype; ApiLink( 'ADVAPI32.DLL', 'BOOLEAN SystemFunction036( PVOID b, ULONG n )' ) or die $^E; our $RtlGenRandom; *RtlGenRandom = *SystemFunction036; my $buffer = chr( 0 ) x ( 4 * $count ); if( RtlGenRandom( $buffer, 4 * $count ) ) { return [ unpack 'V*', $buffer ]; } else { warn "rtlGenRandom failed : $^E"; return; } } print for @{ random( 10 ) }; __END__ P:\test>471107 Name "main::SystemFunction036" used only once: possible typo at P:\test\471107.pl line 11. 2938396619 3012541328 434618806 2806772272 1411585649 1621144589 2620908003 1934412219 3486653462 3699174573