rycher has asked for the wisdom of the Perl Monks concerning the following question:
This is what I have so far:
----------------------------- sub generatePassword { my $length = shift; my $possible = 'abcdefghijkmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUV +WXYZ'; while (length($password) < $length) { $password .= substr($possible, (int(rand(length($possible)))), 1) +; } } sub pleaseGodWork { generatePassword(8); my $readfile = "index.txt"; my $writefile = "index.html"; open (MYFILE, "$readfile") || die ("Cannot open $file: $!"); open (YOURFILE, ">$writefile") || die ("Cannot open $file: $!"); @copy_this = <MYFILE>; print YOURFILE (@copy_this); } close (MYFILE); close (YOURFILE); pleaseGodWork(); exit; -----------------------------
|
|---|