=head1 NAME
-perlfaq4 - Data Manipulation ($Revision: 1.49 $, $Date: 1999/05/23 20:37:49 $)
+perlfaq4 - Data Manipulation ($Revision: 1.2 $, $Date: 2001/09/26 15:42:12 $)
=head1 DESCRIPTION
This has the strange effect of turning "C<don't do it>" into "C<Don'T
Do It>". Sometimes you might want this. Other times you might need a
-more thorough solution (Suggested by brian d. foy):
+more thorough solution (Suggested by brian d foy):
$string =~ s/ (
(^\w) #at the beginning of the line
# generate a random permutation of @array in place
sub fisher_yates_shuffle {
my $array = shift;
- my $i;
- for ($i = @$array; --$i; ) {
+ my $i = @$array;
+ while (--$i) {
my $j = int rand ($i+1);
@$array[$i,$j] = @$array[$j,$i];
}