Perl code to create random string of characters

mixed-case, alphanumeric, 8 chars long

http://www.perlmonks.org/?node_id=233023

#!/usr/bin/perl -wT

use strict;

my @chars = ("A".."Z", "a".."z", "0" .. "9");
my $string;
$string .= $chars[rand @chars] for 1..8;

print $string . "\n";

#perl #programming

From JR's : articles
32 words - 250 chars
created on
updated on - #
source - versions

Related articles
Looping through Perl data types - Nov 25, 2013
Perl testing info links - Dec 03, 2013
Creating Perl Modules and OO Programming - Oct 17, 2013
Perl CGI processing application json data - Feb 25, 2015
Perl regex extracting domain name from URL code example - Oct 02, 2013
more >>



A     A     A     A     A

© 2013-2017 JotHut - Online notebook

current date: May 1, 2024 - 3:47 p.m. EDT