[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Offtopic: Setting Passwords



>	($Lastname, $Firstname) = split (/,/, $Longname);
>	$Firstname =~ s/ //;		# leading (1st) space
>	$last = $Lastname;
>	$first = $Firstname;
>	$last =~ s/([^\W0-9_])/\l$1/g;	# make lowercase
>	$first =~ s/([^\W0-9_])/\l$1/g;	
>	$last =~ s/ /-/g;		# replace spaces with dashes
>	$first =~ s/ /-/g;		
>	$slast = $last;			# create short names
>	$sfirst = $first;
>	$slast =~ s/\W\d//g;		# remove non-characters (\W)
>	$sfirst =~ s/\W\d//g;		# remove numbers \d
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

These last 2 lines are the ones I have changed, however, I haven't actually tested them against an evil set of names.  So I don't know if the new fix will catch everything I can think of -- but I think so.