#! /usr/bin/perl -w use strict; # Creates passwords from a customizable list of characters # (To make it easier on users, don't use zero or capital 'O', for example) # # *Not* a completely security-conscious implementation, especially when # generating multiple passwords at once... # # Change @Chars to suit your preference # Change the inner for loop to determine password length # # Usage: $0 [Number of passwords to generate] my @Chars = split '', 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789@#$%&*=+_<>?~'; for (1..($ARGV[0] ||= 1)){ my $Password; for (1..6){ $Password .= $Chars[rand @Chars]; } print "$Password\n"; }