D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
blackhat.pw
:
/
kunden
/
proc
/
self
/
root
/
usr
/
share
/
doc
/
libbytes-random-secure-perl
/
examples
/
Filename :
random-from.pl
back
Copy
use strict; use warnings; use utf8; use Bytes::Random::Secure qw( random_string_from ); my $quantity = 64; my $bag = 'abcde'; # Generate a random string of 64 characters, each selected from # the "bag" of 'a' through 'e', inclusive. my $string = random_string_from( $bag, $quantity ); print $string, "\n"; # Unicode strings are ok too (Perl 5.8.9 or better): if( $^V && $^V ge v5.8.9 ) { $string = random_string_from( 'Ѧѧ', 64 ); binmode STDOUT, ':encoding(UTF-8)'; print $string, "\n"; }