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
Yo-Perl Readme - Aug 19, 2014
Perl CGI setting headers - Oct 04, 2013
Web and mobile development using Perl, HTML5, CSS3, and JavaScript - May 28, 2013
Using Perl and Erlang - Jan 19, 2015
Perl Dancer Framework - Dec 19, 2013
more >>



A     A     A     A     A

© 2013-2017 JotHut - Online notebook

current date: Jan 12, 2025 - 6:05 a.m. EST