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
Perl Programming Environments - May 06, 2013
Run perl script as a daemon - Nov 14, 2014
Probably my favorite Web apps to use and create - Jan 15, 2014
Perl try, catch, eval, die, warn, carp - Jun 25, 2013
Scaup web publishing app update as of Feb 21, 2015 - Mar 02, 2015
more >>



A     A     A     A     A

© 2013-2017 JotHut - Online notebook

current date: Apr 18, 2024 - 4:48 a.m. EDT