View Single Post
Old 03-20-2005, 03:19 AM  
bbe
Confirmed User
 
Join Date: Feb 2005
Posts: 110
#!/usr/bin/perl

# Read File
while (<>) {
push(foo, $_);
}

# Shuffle lines
srand;
for (0..$#foo) {
$r = rand($#foo+1);
($foo[$r], $foo[$_]) = ($foo[$_], $foo[$r]);
}

# Print it out
for (0..$#foo) {
print $foo[$_];
}
bbe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote