MacOSX.com Perl Accociation

xoot

Got xoot?
Welcome to the MacOSX.com Perl Association. This iss where you get to post your perl scripts.

Here is one of mine:
Code:
#!/usr/bin/perl
# 
# rpass - random password generator
# 
# by xoot

use strict;

srand;
my ($password, @chars, $length);
@chars = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
'.', '/', '$', '#', '@', '!', '%', '^', '&', '*', '(', ')', '-', '=', '+', '_', '|', '<', '>', '?', '\\');
if (@ARGV == 1) {
	$length = $ARGV[0];
} else {
	print "Enter password length: ";
	chomp($length = <STDIN>);
}
if ($length =~ /[^0-9]/) {
	print "Invalid length.\n";
	exit(1);
}
while ($length != 0) {
	$length--;
	$password .= $chars[rand(@chars)];
}
print "Password: " . $password . "\n";

Have fun! :)
 
Here's my random perl script:

-------------------------------------------------------
s^^/hfe/ova/znvy ^;s!$!ogbarvyy\@crey.arg!;y+a-zA-Z+n-za-mN-ZA-M+;open(F,"|$_")
;s*$_*Fhowrpg: jurr!\n\n\n*;y~a-zA-Z~n-za-mN-ZA-M~;print F;while(<>){print F}
-------------------------------------------------------

Some UNIX boxes it will work right if things are configured correctly, others it won't. But don't worry, doesn't do anything bad :)


Brian
 
ahhh, come on, has to be more perl folks out there who want to post some wacky code :)

Brian
 
... the three lines of Perl that decypher CSS - AND it ran fast enough to use as a real-time decoder for a player :) I had them saved somewhere, but can't find them now :((( ... if anyone knows what I'm on about and has them - could you post them here??
C
 
Back
Top